From 7b9091428c5d4f96c06b5fa53de5faa8d09f25a8 Mon Sep 17 00:00:00 2001 From: David Chavez Date: Mon, 4 Nov 2024 14:26:06 +0100 Subject: [PATCH] Fixup builds --- CMakeLists.txt | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7952336..f21bdcc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -275,6 +275,7 @@ if (WIN32) ) target_sources(Zelda64Recompiled PRIVATE ${CMAKE_SOURCE_DIR}/icons/app.rc) + target_link_libraries(Zelda64Recompiled PRIVATE SDL2) endif() if (APPLE) @@ -285,7 +286,7 @@ if (APPLE) set(THREADS_PREFER_PTHREAD_FLAG TRUE) find_package(Threads REQUIRED) - target_link_libraries(Zelda64Recompiled PRIVATE ${CMAKE_DL_LIBS} Threads::Threads) + target_link_libraries(Zelda64Recompiled PRIVATE ${CMAKE_DL_LIBS} Threads::Threads SDL2::SDL2) # Set bundle properties set_target_properties(Zelda64Recompiled PROPERTIES @@ -345,33 +346,33 @@ if (APPLE) # Post-build steps for macOS bundle add_custom_command(TARGET Zelda64Recompiled POST_BUILD - # 1. Copy and fix frameworks first + # Copy and fix frameworks first COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/.github/macos/fixup_bundle.cmake - # 2. Copy all resources + # Copy all resources COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/assets ${CMAKE_BINARY_DIR}/temp_assets COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/temp_assets/scss COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/temp_assets $/Contents/Resources/assets COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/temp_assets - # 3. Copy Vulkan ICD files + # Copy Vulkan ICD files COMMAND ${CMAKE_COMMAND} -E make_directory $/Contents/Resources/vulkan/icd.d COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/.github/macOS/MoltenVK_icd.json $/Contents/Resources/vulkan/icd.d/ - # 4. Copy controller database + # Copy controller database COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/gamecontrollerdb.txt $/Contents/Resources/ - # 5. Set RPATH + # Set RPATH COMMAND install_name_tool -add_rpath "@executable_path/../Frameworks/" $/Contents/MacOS/Zelda64Recompiled - # 6. Apply JIT workaround + # Apply JIT workaround COMMAND ${CMAKE_COMMAND} -E echo "Applying JIT compilation workaround" COMMAND /bin/bash -c "printf '\\x07' | dd of=$ bs=1 seek=160 count=1 conv=notrunc" - # 7. Sign frameworks first - COMMAND codesign --force --sign - $/Contents/Frameworks/* + # Sign frameworks first + COMMAND /bin/bash -c "for f in $/Contents/Frameworks/*; do codesign --force --sign - \"$f\"; done" - # 8. Finally sign the whole bundle with runtime option + # Finally sign the whole bundle with runtime option COMMAND codesign --deep --force --sign - --options runtime $ COMMENT "Performing post-build steps for macOS bundle" @@ -410,7 +411,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux") message(STATUS "FREETYPE_LIBRARIES = ${FREETYPE_LIBRARIES}") include_directories(${FREETYPE_LIBRARIES}) - target_link_libraries(Zelda64Recompiled PRIVATE ${FREETYPE_LIBRARIES}) + target_link_libraries(Zelda64Recompiled PRIVATE ${FREETYPE_LIBRARIES} SDL2::SDL2) set(CMAKE_THREAD_PREFER_PTHREAD TRUE) set(THREADS_PREFER_PTHREAD_FLAG TRUE) @@ -422,7 +423,6 @@ endif() target_link_libraries(Zelda64Recompiled PRIVATE PatchesLib RecompiledFuncs - SDL2::SDL2 librecomp ultramodern rt64