From c54964a44ac798ea2956dec3cc0a90631c544d3b Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Mon, 30 Dec 2024 18:43:36 -0700 Subject: [PATCH] meson: Convert volk submodule to a subproject --- .gitmodules | 3 --- configure | 2 +- scripts/archive-source.sh | 2 +- subprojects/volk.wrap | 4 ++++ thirdparty/meson.build | 9 +++++++-- thirdparty/volk | 1 - 6 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 subprojects/volk.wrap delete mode 160000 thirdparty/volk diff --git a/.gitmodules b/.gitmodules index 420d7d9cd2..a0f46b92d4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -91,9 +91,6 @@ [submodule "hw/xbox/nv2a/pgraph/vk/thirdparty/VulkanMemoryAllocator"] path = thirdparty/VulkanMemoryAllocator url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator -[submodule "thirdparty/volk"] - path = thirdparty/volk - url = https://github.com/zeux/volk [submodule "thirdparty/SPIRV-Reflect"] path = thirdparty/SPIRV-Reflect url = https://github.com/KhronosGroup/SPIRV-Reflect diff --git a/configure b/configure index 880f30c4bd..379ba278a3 100755 --- a/configure +++ b/configure @@ -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/volk thirdparty/VulkanMemoryAllocator thirdparty/SPIRV-Reflect" +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 thirdparty/SPIRV-Reflect" git="git" # Don't accept a target_list environment variable. diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh index e20751e50e..50b066c1f2 100755 --- a/scripts/archive-source.sh +++ b/scripts/archive-source.sh @@ -32,7 +32,7 @@ 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/volk thirdparty/VulkanMemoryAllocator thirdparty/SPIRV-Reflect" +submodules="$submodules thirdparty/VulkanMemoryAllocator thirdparty/SPIRV-Reflect" sub_deinit="" diff --git a/subprojects/volk.wrap b/subprojects/volk.wrap new file mode 100644 index 0000000000..8089cbce56 --- /dev/null +++ b/subprojects/volk.wrap @@ -0,0 +1,4 @@ +[wrap-git] +url=https://github.com/zeux/volk +revision=1.3.295 +depth=1 diff --git a/thirdparty/meson.build b/thirdparty/meson.build index 8bd29db98e..1531110dfa 100644 --- a/thirdparty/meson.build +++ b/thirdparty/meson.build @@ -1,7 +1,12 @@ if vulkan.found() -libvolk = static_library('volk', sources: 'volk/volk.c', c_args: ['-DVK_NO_PROTOTYPES'], dependencies: vulkan) -volk = declare_dependency(compile_args: ['-DVK_NO_PROTOTYPES'], include_directories: 'volk', link_with: libvolk, dependencies: vulkan) +volk_opts = cmake.subproject_options() +volk_opts.add_cmake_defines({'VOLK_STATIC_DEFINES': 'VK_NO_PROTOTYPES'}) +volk_subproj = cmake.subproject('volk', options: volk_opts) +volk = declare_dependency(compile_args: ['-DVK_NO_PROTOTYPES'], + include_directories: volk_subproj.include_directories('volk'), + link_with: volk_subproj.target('volk'), + dependencies: vulkan) debug_vma = false diff --git a/thirdparty/volk b/thirdparty/volk deleted file mode 160000 index 466085407d..0000000000 --- a/thirdparty/volk +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 466085407d5d2f50583fd663c1d65f93a7709d3e