Merge pull request #10934 from abouvier/cmake-vma
cmake: allow using system VMA library
This commit is contained in:
commit
5593bed08a
2
.gitmodules
vendored
2
.gitmodules
vendored
|
@ -56,5 +56,5 @@
|
||||||
path = externals/nx_tzdb/tzdb_to_nx
|
path = externals/nx_tzdb/tzdb_to_nx
|
||||||
url = https://github.com/lat9nq/tzdb_to_nx.git
|
url = https://github.com/lat9nq/tzdb_to_nx.git
|
||||||
[submodule "VulkanMemoryAllocator"]
|
[submodule "VulkanMemoryAllocator"]
|
||||||
path = externals/vma/VulkanMemoryAllocator
|
path = externals/VulkanMemoryAllocator
|
||||||
url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
|
url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
|
||||||
|
|
|
@ -293,6 +293,7 @@ find_package(LLVM MODULE COMPONENTS Demangle)
|
||||||
find_package(lz4 REQUIRED)
|
find_package(lz4 REQUIRED)
|
||||||
find_package(nlohmann_json 3.8 REQUIRED)
|
find_package(nlohmann_json 3.8 REQUIRED)
|
||||||
find_package(Opus 1.3 MODULE)
|
find_package(Opus 1.3 MODULE)
|
||||||
|
find_package(VulkanMemoryAllocator CONFIG)
|
||||||
find_package(ZLIB 1.2 REQUIRED)
|
find_package(ZLIB 1.2 REQUIRED)
|
||||||
find_package(zstd 1.5 REQUIRED)
|
find_package(zstd 1.5 REQUIRED)
|
||||||
|
|
||||||
|
|
6
externals/CMakeLists.txt
vendored
6
externals/CMakeLists.txt
vendored
|
@ -144,9 +144,9 @@ endif()
|
||||||
add_subdirectory(nx_tzdb)
|
add_subdirectory(nx_tzdb)
|
||||||
|
|
||||||
# VMA
|
# VMA
|
||||||
add_library(vma vma/vma.cpp)
|
if (NOT TARGET GPUOpen::VulkanMemoryAllocator)
|
||||||
target_include_directories(vma PUBLIC ./vma/VulkanMemoryAllocator/include)
|
add_subdirectory(VulkanMemoryAllocator)
|
||||||
target_link_libraries(vma PRIVATE Vulkan::Headers)
|
endif()
|
||||||
|
|
||||||
if (NOT TARGET LLVM::Demangle)
|
if (NOT TARGET LLVM::Demangle)
|
||||||
add_library(demangle demangle/ItaniumDemangle.cpp)
|
add_library(demangle demangle/ItaniumDemangle.cpp)
|
||||||
|
|
1
externals/VulkanMemoryAllocator
vendored
Submodule
1
externals/VulkanMemoryAllocator
vendored
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 9b0fc3e7b02afe97895eb3e945fe800c3a7485ac
|
1
externals/vma/VulkanMemoryAllocator
vendored
1
externals/vma/VulkanMemoryAllocator
vendored
|
@ -1 +0,0 @@
|
||||||
Subproject commit 0aa3989b8f382f185fdf646cc83a1d16fa31d6ab
|
|
|
@ -274,6 +274,7 @@ add_library(video_core STATIC
|
||||||
vulkan_common/vulkan_wrapper.h
|
vulkan_common/vulkan_wrapper.h
|
||||||
vulkan_common/nsight_aftermath_tracker.cpp
|
vulkan_common/nsight_aftermath_tracker.cpp
|
||||||
vulkan_common/nsight_aftermath_tracker.h
|
vulkan_common/nsight_aftermath_tracker.h
|
||||||
|
vulkan_common/vma.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
create_target_directory_groups(video_core)
|
create_target_directory_groups(video_core)
|
||||||
|
@ -291,7 +292,7 @@ target_link_options(video_core PRIVATE ${FFmpeg_LDFLAGS})
|
||||||
|
|
||||||
add_dependencies(video_core host_shaders)
|
add_dependencies(video_core host_shaders)
|
||||||
target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE})
|
target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE})
|
||||||
target_link_libraries(video_core PRIVATE sirit Vulkan::Headers vma)
|
target_link_libraries(video_core PRIVATE sirit Vulkan::Headers GPUOpen::VulkanMemoryAllocator)
|
||||||
|
|
||||||
if (ENABLE_NSIGHT_AFTERMATH)
|
if (ENABLE_NSIGHT_AFTERMATH)
|
||||||
if (NOT DEFINED ENV{NSIGHT_AFTERMATH_SDK})
|
if (NOT DEFINED ENV{NSIGHT_AFTERMATH_SDK})
|
||||||
|
@ -324,6 +325,9 @@ else()
|
||||||
|
|
||||||
# xbyak
|
# xbyak
|
||||||
set_source_files_properties(macro/macro_jit_x64.cpp PROPERTIES COMPILE_OPTIONS "-Wno-conversion;-Wno-shadow")
|
set_source_files_properties(macro/macro_jit_x64.cpp PROPERTIES COMPILE_OPTIONS "-Wno-conversion;-Wno-shadow")
|
||||||
|
|
||||||
|
# VMA
|
||||||
|
set_source_files_properties(vulkan_common/vma.cpp PROPERTIES COMPILE_OPTIONS "-Wno-conversion;-Wno-unused-variable;-Wno-unused-parameter;-Wno-missing-field-initializers")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ARCHITECTURE_x86_64)
|
if (ARCHITECTURE_x86_64)
|
||||||
|
|
Loading…
Reference in a new issue