From 615748fe4bb2abb5c709ef37efd60984007ba637 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Mon, 30 Dec 2024 18:54:57 -0700 Subject: [PATCH] meson: Convert SPIRV-Reflect submodule to a subproject --- .gitmodules | 3 --- configure | 2 +- scripts/archive-source.sh | 2 +- scripts/gen-license.py | 2 +- subprojects/SPIRV-Reflect.wrap | 4 ++++ thirdparty/SPIRV-Reflect | 1 - thirdparty/meson.build | 8 ++++++-- 7 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 subprojects/SPIRV-Reflect.wrap delete mode 160000 thirdparty/SPIRV-Reflect diff --git a/.gitmodules b/.gitmodules index a0f46b92d4..0e4365649b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -91,6 +91,3 @@ [submodule "hw/xbox/nv2a/pgraph/vk/thirdparty/VulkanMemoryAllocator"] path = thirdparty/VulkanMemoryAllocator url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator -[submodule "thirdparty/SPIRV-Reflect"] - path = thirdparty/SPIRV-Reflect - url = https://github.com/KhronosGroup/SPIRV-Reflect diff --git a/configure b/configure index 379ba278a3..b76dade5cb 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/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" git="git" # Don't accept a target_list environment variable. diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh index 50b066c1f2..e26266c0d4 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/VulkanMemoryAllocator thirdparty/SPIRV-Reflect" +submodules="$submodules thirdparty/VulkanMemoryAllocator" sub_deinit="" diff --git a/scripts/gen-license.py b/scripts/gen-license.py index 817b0b2ae3..3389e68a87 100755 --- a/scripts/gen-license.py +++ b/scripts/gen-license.py @@ -254,7 +254,7 @@ Lib('VulkanMemoryAllocator', 'https://github.com/GPUOpen-LibrariesAndSDKs/Vulkan Lib('SPIRV-Reflect', 'https://github.com/KhronosGroup/SPIRV-Reflect', apache2, 'https://raw.githubusercontent.com/KhronosGroup/SPIRV-Reflect/main/LICENSE', ships_static=all_platforms, - submodule=Submodule('thirdparty/SPIRV-Reflect') + submodule=Submodule('subprojects/SPIRV-Reflect.wrap') ), # diff --git a/subprojects/SPIRV-Reflect.wrap b/subprojects/SPIRV-Reflect.wrap new file mode 100644 index 0000000000..6893ea7ecb --- /dev/null +++ b/subprojects/SPIRV-Reflect.wrap @@ -0,0 +1,4 @@ +[wrap-git] +url=https://github.com/KhronosGroup/SPIRV-Reflect +revision=vulkan-sdk-1.3.296.0 +depth=1 diff --git a/thirdparty/SPIRV-Reflect b/thirdparty/SPIRV-Reflect deleted file mode 160000 index 1d674a82d7..0000000000 --- a/thirdparty/SPIRV-Reflect +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1d674a82d7e102ed0c02e64e036827db9e8b1a71 diff --git a/thirdparty/meson.build b/thirdparty/meson.build index 1531110dfa..09cb9311a8 100644 --- a/thirdparty/meson.build +++ b/thirdparty/meson.build @@ -25,7 +25,11 @@ 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) -libspirv_reflect = static_library('spirv_reflect', sources: 'SPIRV-Reflect/spirv_reflect.c', dependencies: vulkan) -spirv_reflect = declare_dependency(include_directories: 'SPIRV-Reflect', link_with: libspirv_reflect, dependencies: vulkan) +spirv_reflect_opts = cmake.subproject_options() +spirv_reflect_opts.add_cmake_defines({'SPIRV_REFLECT_STATIC_LIB': 'ON'}) +spirv_reflect_subproj = cmake.subproject('SPIRV-Reflect', options: spirv_reflect_opts) +spirv_reflect = declare_dependency(include_directories: spirv_reflect_subproj.include_directories('spirv-reflect-static'), + link_with: spirv_reflect_subproj.target('spirv-reflect-static'), + dependencies: vulkan) endif