Build: Fix DiscordRPC not being included in Mac bundle

This commit is contained in:
Stenzek 2024-07-14 21:23:16 +10:00
parent 500fbe5ef1
commit df979d4648
No known key found for this signature in database
3 changed files with 12 additions and 5 deletions

View file

@ -200,6 +200,13 @@ endfunction()
function(add_core_resources target) function(add_core_resources target)
add_util_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/*) file(GLOB_RECURSE RESOURCE_FILES ${CMAKE_SOURCE_DIR}/data/resources/*)
foreach(path IN LISTS RESOURCE_FILES) foreach(path IN LISTS RESOURCE_FILES)
get_filename_component(file ${path} NAME) get_filename_component(file ${path} NAME)

View file

@ -242,11 +242,6 @@ elseif(APPLE)
endif() endif()
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 # Copy icon into the bundle
target_sources(duckstation-qt PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/DuckStation.icns") 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) set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/DuckStation.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)

View file

@ -290,5 +290,10 @@ function(add_util_resources target)
else() else()
message(WARNING "MoltenVK not found in path, it will depend on the target system having it.") message(WARNING "MoltenVK not found in path, it will depend on the target system having it.")
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)
endif() endif()
endfunction() endfunction()