meson: Convert VulkanMemoryAllocator submodule to a subproject

This commit is contained in:
Matt Borgerson 2024-12-30 19:18:41 -07:00 committed by mborgerson
parent 615748fe4b
commit 209c0991a1
7 changed files with 24 additions and 17 deletions

3
.gitmodules vendored
View File

@ -88,6 +88,3 @@
[submodule "ui/thirdparty/httplib"]
path = ui/thirdparty/httplib
url = https://github.com/yhirose/cpp-httplib
[submodule "hw/xbox/nv2a/pgraph/vk/thirdparty/VulkanMemoryAllocator"]
path = thirdparty/VulkanMemoryAllocator
url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator

2
configure vendored
View File

@ -237,7 +237,7 @@ else
git_submodules_action="ignore"
fi
git_submodules="ui/keycodemapdb ui/thirdparty/imgui ui/thirdparty/implot ui/thirdparty/httplib util/xxHash tomlplusplus genconfig hw/xbox/nv2a/pgraph/thirdparty/nv2a_vsh_cpu thirdparty/VulkanMemoryAllocator"
git_submodules="ui/keycodemapdb ui/thirdparty/imgui ui/thirdparty/implot ui/thirdparty/httplib util/xxHash tomlplusplus genconfig hw/xbox/nv2a/pgraph/thirdparty/nv2a_vsh_cpu"
git="git"
# Don't accept a target_list environment variable.

View File

@ -32,7 +32,6 @@ submodules="$submodules tests/fp/berkeley-softfloat-3 tests/fp/berkeley-testfloa
# xemu extras
submodules="$submodules ui/thirdparty/imgui ui/thirdparty/implot ui/thirdparty/httplib util/xxHash tomlplusplus genconfig"
submodules="$submodules hw/xbox/nv2a/pgraph/thirdparty/nv2a_vsh_cpu"
submodules="$submodules thirdparty/VulkanMemoryAllocator"
sub_deinit=""

View File

@ -248,7 +248,7 @@ Lib('volk', 'https://github.com/zeux/volk',
Lib('VulkanMemoryAllocator', 'https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator',
mit, 'https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/master/LICENSE.txt',
ships_static=all_platforms,
submodule=Submodule('thirdparty/VulkanMemoryAllocator')
submodule=Submodule('subprojects/VulkanMemoryAllocator.wrap')
),
Lib('SPIRV-Reflect', 'https://github.com/KhronosGroup/SPIRV-Reflect',

View File

@ -0,0 +1,4 @@
[wrap-git]
url=https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
revision=v3.2.0
depth=1

@ -1 +0,0 @@
Subproject commit 3bab6924988e5f19bf36586a496156cf72f70d9f

View File

@ -11,19 +11,27 @@ volk = declare_dependency(compile_args: ['-DVK_NO_PROTOTYPES'],
debug_vma = false
vma_defns = [
'-DVMA_STATIC_VULKAN_FUNCTIONS=0',
'-DVMA_DYNAMIC_VULKAN_FUNCTIONS=0',
]
'-DVMA_STATIC_VULKAN_FUNCTIONS=0',
'-DVMA_DYNAMIC_VULKAN_FUNCTIONS=0',
]
if debug_vma
vma_defns += [
'-DVMA_DEBUG_MARGIN=16',
'-DVMA_DEBUG_DETECT_CORRUPTION=1',
'-DVMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY=256',
]
vma_defns += [
'-DVMA_DEBUG_MARGIN=16',
'-DVMA_DEBUG_DETECT_CORRUPTION=1',
'-DVMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY=256',
]
endif
libvma = static_library('vma', sources: 'vma.cc', cpp_args: vma_defns, include_directories: 'VulkanMemoryAllocator/include', dependencies: [vulkan, volk])
vma = declare_dependency(compile_args: vma_defns, include_directories: 'VulkanMemoryAllocator/include', link_with: libvma)
vma_subproj = cmake.subproject('VulkanMemoryAllocator')
libvma = static_library('vma',
sources: 'vma.cc',
cpp_args: vma_defns,
include_directories: vma_subproj.include_directories('VulkanMemoryAllocator'),
dependencies: [vulkan, volk])
vma = declare_dependency(include_directories: vma_subproj.include_directories('VulkanMemoryAllocator'),
link_with: libvma,
dependencies: vulkan)
spirv_reflect_opts = cmake.subproject_options()
spirv_reflect_opts.add_cmake_defines({'SPIRV_REFLECT_STATIC_LIB': 'ON'})