From 29c37b8ae4e7055b105c4d4e6c71c126170e3bb6 Mon Sep 17 00:00:00 2001 From: adam-bloom Date: Sat, 2 Jan 2021 22:08:57 -0700 Subject: [PATCH] enable discord-rpc from vcpkg dependencies --- .github/workflows/ci.yml | 3 +-- CMakeLists.txt | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a413f649e..434cff3af4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -155,9 +155,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v1 - # Note: Discord_RPC can be enabled soon, requires one more CMakeLists update - name: Build OpenRCT2 - run: . scripts/setenv -q && build -DWITH_TESTS=on -DDISABLE_DISCORD_RPC=on -DCMAKE_BUILD_TYPE=MinSizeRel + run: . scripts/setenv -q && build -DWITH_TESTS=on -DCMAKE_BUILD_TYPE=MinSizeRel - name: Run Tests shell: bash run: . scripts/setenv -q && run-tests diff --git a/CMakeLists.txt b/CMakeLists.txt index cf3136dd5f..aa25cb555a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -207,9 +207,11 @@ if (NOT DISABLE_DISCORD_RPC) add_definitions(-D__ENABLE_DISCORD__) include_directories(DISCORDRPC_PROCESS_INCLUDES) endif() - endif() - - if (NOT HAVE_DISCORD_RPC AND EXISTS "${ROOT_DIR}/discord-rpc") + elseif (APPLE AND MACOS_USE_DEPENDENCIES) + add_definitions(-D__ENABLE_DISCORD__) + set(HAVE_DISCORD_RPC TRUE) + message("Building with libdiscord-rpc.dylib") + elseif(NOT HAVE_DISCORD_RPC AND EXISTS "${ROOT_DIR}/discord-rpc") # Don't build discord's examples, some of which are in C and do not honour # the flags we set for C++. Also we don't use the provided examples. set(BUILD_EXAMPLES OFF CACHE BOOL "Build example apps")