Skip to content

Commit

Permalink
CMake: Add USE_HOST_VULKAN_MEMORY_ALLOCATOR
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Wong committed Feb 12, 2025
1 parent 7278be8 commit 1a46449
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ option(USE_HOST_VULKAN_HEADERS "Use host Vulkan headers" OFF)
option(USE_HOST_XXHASH "Use host libxxhash" OFF)
option(USE_HOST_GLM "Use host glm" OFF)
option(USE_HOST_GTEST "Use host googletest" OFF)
option(USE_HOST_VULKAN_MEMORY_ALLOCATOR "Use host Vulkan memory allocator" OFF)
option(USE_OPENMP "Use OpenMP if available" ON)
option(USE_VULKAN "Build with Vulkan support" ON)
option(USE_DX9 "Build with Direct3D 9 support" ON)
Expand Down Expand Up @@ -1415,8 +1416,12 @@ if(USE_VULKAN)
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE Vulkan::Headers)

add_subdirectory(core/deps/VulkanMemoryAllocator)
target_compile_options(VulkanMemoryAllocator INTERFACE $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-Wno-nullability-completeness>)
if(USE_HOST_VULKAN_MEMORY_ALLOCATOR)
find_package(VulkanMemoryAllocator CONFIG REQUIRED)
else()
add_subdirectory(core/deps/VulkanMemoryAllocator)
target_compile_options(VulkanMemoryAllocator INTERFACE $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-Wno-nullability-completeness>)
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE GPUOpen::VulkanMemoryAllocator)

if(ANDROID AND NOT LIBRETRO AND "arm64" IN_LIST ARCHITECTURE)
Expand Down

0 comments on commit 1a46449

Please sign in to comment.