Skip to content

Commit

Permalink
Build: Fix DiscordRPC not being included in Mac bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Jul 14, 2024
1 parent 500fbe5 commit df979d4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions src/duckstation-qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions src/util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit df979d4

Please sign in to comment.