diff --git a/CMakeLists.txt b/CMakeLists.txt index fab52fb29..ac24d421d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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 $<$,$>:-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 $<$,$>:-Wno-nullability-completeness>) + endif() target_link_libraries(${PROJECT_NAME} PRIVATE GPUOpen::VulkanMemoryAllocator) if(ANDROID AND NOT LIBRETRO AND "arm64" IN_LIST ARCHITECTURE)