diff options
| author | Juan Ramos <juan@lunarg.com> | 2023-12-19 21:03:32 -0700 |
|---|---|---|
| committer | Juan Ramos <114601453+juan-lunarg@users.noreply.github.com> | 2023-12-20 10:03:27 -0700 |
| commit | b42addf414739c48fdb7683febe47057c890b1ab (patch) | |
| tree | e790eff860a9f379d2c891bc258645d16470469d | |
| parent | 87130b22e74cb208bf8ecd755dcf40dabd365dad (diff) | |
| download | usermoji-b42addf414739c48fdb7683febe47057c890b1ab.tar.xz | |
Fix MacOS installation of vkcube
Now the loader is installed in the app so it is self-contained.
Just requires fixing up the RPATH.
closes #921
| -rw-r--r-- | .github/workflows/tools.yml | 14 | ||||
| -rw-r--r-- | cube/CMakeLists.txt | 34 |
2 files changed, 23 insertions, 25 deletions
diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index e6d34547..ebc10a56 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -158,17 +158,13 @@ jobs: - name: Add ccache to PATH run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - - name: Configure - run: cmake -S. -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -D UPDATE_DEPS=ON -D INSTALL_ICD=ON -D BUILD_TESTS=ON -D ENABLE_ADDRESS_SANITIZER=ON -D BUILD_WERROR=ON - env: - MACOSX_DEPLOYMENT_TARGET: 10.15 + - run: cmake -S. -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -D UPDATE_DEPS=ON -D INSTALL_ICD=ON -D BUILD_TESTS=ON -D ENABLE_ADDRESS_SANITIZER=ON -D BUILD_WERROR=ON - - name: Build - run: cmake --build build + - run: cmake --build build - - name: Test - working-directory: ./build - run: ctest --output-on-failure + - run: ctest --output-on-failure --test-dir build/ + + - run: cmake --install build --prefix /tmp android: runs-on: ubuntu-22.04 diff --git a/cube/CMakeLists.txt b/cube/CMakeLists.txt index 00feaf19..266e90de 100644 --- a/cube/CMakeLists.txt +++ b/cube/CMakeLists.txt @@ -255,14 +255,15 @@ target_compile_definitions(vkcube PRIVATE VK_NO_PROTOTYPES) if (ANDROID) install(TARGETS vkcube DESTINATION ${CMAKE_INSTALL_LIBDIR}) elseif(APPLE) - # Keep RPATH so fixup_bundle can use it to find libraries - set_target_properties(vkcube PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) - install(TARGETS vkcube BUNDLE DESTINATION "cube") - # Fix up the library references to be self-contained within the bundle. - install(CODE " - include(BundleUtilities) - fixup_bundle(\${CMAKE_INSTALL_PREFIX}/cube/vkcube.app \"\" \"\") - ") + install( + TARGETS vkcube + # Install runtime dependencies like the Vulkan::Loader so the app is self-contained + RUNTIME_DEPENDENCIES DESTINATION "cube/vkcube.app/Contents/Frameworks/" + BUNDLE DESTINATION "cube" + ) + set_target_properties(vkcube PROPERTIES + INSTALL_RPATH @executable_path/../Frameworks + ) else() install(TARGETS vkcube) endif() @@ -300,14 +301,15 @@ target_include_directories(vkcubepp PRIVATE .) target_compile_definitions(vkcubepp PRIVATE VK_NO_PROTOTYPES) if(APPLE) - # Keep RPATH so fixup_bundle can use it to find libraries - set_target_properties(vkcubepp PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) - install(TARGETS vkcubepp BUNDLE DESTINATION "cube") - # Fix up the library references to be self-contained within the bundle. - install(CODE " - include(BundleUtilities) - fixup_bundle(\${CMAKE_INSTALL_PREFIX}/cube/vkcubepp.app \"\" \"\") - ") + install( + TARGETS vkcubepp + # Install runtime dependencies like the Vulkan::Loader so the app is self-contained + RUNTIME_DEPENDENCIES DESTINATION "cube/vkcubepp.app/Contents/Frameworks/" + BUNDLE DESTINATION "cube" + ) + set_target_properties(vkcubepp PROPERTIES + INSTALL_RPATH @executable_path/../Frameworks + ) else() install(TARGETS vkcubepp) endif() |
