From df979d4648eec73ed8b3ab61fe246706670574a0 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 14 Jul 2024 21:23:16 +1000 Subject: [PATCH] Build: Fix DiscordRPC not being included in Mac bundle --- src/core/CMakeLists.txt | 7 +++++++ src/duckstation-qt/CMakeLists.txt | 5 ----- src/util/CMakeLists.txt | 5 +++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 02c661d31..c2fd83d1c 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -200,6 +200,13 @@ endfunction() function(add_core_resources target) add_util_resources(${target}) + if(APPLE) + # Copy discord-rpc into the bundle + get_target_property(DISCORD_RPC_LIBRARY DiscordRPC::discord-rpc IMPORTED_LOCATION_RELEASE) + target_sources(${target} PRIVATE "${DISCORD_RPC_LIBRARY}") + set_source_files_properties("${DISCORD_RPC_LIBRARY}" PROPERTIES MACOSX_PACKAGE_LOCATION Frameworks) + endif() + file(GLOB_RECURSE RESOURCE_FILES ${CMAKE_SOURCE_DIR}/data/resources/*) foreach(path IN LISTS RESOURCE_FILES) get_filename_component(file ${path} NAME) diff --git a/src/duckstation-qt/CMakeLists.txt b/src/duckstation-qt/CMakeLists.txt index 1f07aa762..83577213e 100644 --- a/src/duckstation-qt/CMakeLists.txt +++ b/src/duckstation-qt/CMakeLists.txt @@ -242,11 +242,6 @@ elseif(APPLE) endif() endif() - # Copy shaderc into the bundle - get_target_property(SPIRV_CROSS_LIBRARY spirv-cross-c-shared IMPORTED_LOCATION_RELEASE) - target_sources(duckstation-qt PRIVATE "${SHADERC_LIBRARY}" "${SPIRV_CROSS_LIBRARY}") - set_source_files_properties("${SHADERC_LIBRARY}" "${SPIRV_CROSS_LIBRARY}" PROPERTIES MACOSX_PACKAGE_LOCATION Frameworks) - # Copy icon into the bundle target_sources(duckstation-qt PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/DuckStation.icns") set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/DuckStation.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources) diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index 37437bc25..c555cce3a 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -290,5 +290,10 @@ function(add_util_resources target) else() message(WARNING "MoltenVK not found in path, it will depend on the target system having it.") endif() + + # Copy shaderc into the bundle + get_target_property(SPIRV_CROSS_LIBRARY spirv-cross-c-shared IMPORTED_LOCATION_RELEASE) + target_sources(duckstation-qt PRIVATE "${SHADERC_LIBRARY}" "${SPIRV_CROSS_LIBRARY}") + set_source_files_properties("${SHADERC_LIBRARY}" "${SPIRV_CROSS_LIBRARY}" PROPERTIES MACOSX_PACKAGE_LOCATION Frameworks) endif() endfunction()