Skip to content

Commit

Permalink
add fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
tomadamatkinson committed Nov 4, 2024
1 parent 90a11a2 commit 9ff943d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion bldsys/cmake/global_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,18 @@ if(APPLE)
endif()
elseif(IOS)
# if not using MoltenVK on iOS, set up global Vulkan Library define for iOS Vulkan loader
add_compile_definitions(_HPP_VULKAN_LIBRARY=${Vulkan_LIBRARY})
message(STATUS "Using iOS Vulkan loader")
add_compile_definitions(_HPP_VULKAN_LIBRARY="vulkan.framework/vulkan")
elseif(Vulkan_LIBRARY)
# This is a patch for newer macOS versions where the Vulkan Loader is not found in the default search paths
# In the future this can be removed when the Vulkan SDK is updated to install the loader in the default search paths or when the
# VulkanHPP DynamicLoader is updated to search for the loader in the Vulkan SDK install location
string(FIND "${Vulkan_LIBRARY}" "/usr/local/lib" VULKAN_LIBRARY_PREFIX)
if(VULKAN_LIBRARY_PREFIX EQUAL 0)
message(STATUS "Vulkan found in /usr/local/lib. Patching RPATH.")
set(CMAKE_INSTALL_RPATH "/usr/local/lib;${CMAKE_INSTALL_RPATH}")
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
endif()
endif()

if(CMAKE_GENERATOR MATCHES "Xcode")
Expand Down

0 comments on commit 9ff943d

Please sign in to comment.