From 0998d33d7213c1941e89a38119349ab0ced8a687 Mon Sep 17 00:00:00 2001 From: Stephan Lachnit Date: Tue, 17 Mar 2020 11:18:10 +0100 Subject: [PATCH] Use Vulkan-Headers module via wrap This commit replaces the git submodule for the Vulkan headers with meson subproject using wrap. Signed-off-by: Stephan Lachnit --- .gitignore | 4 ++++ meson.build | 6 +++--- modules/Vulkan-Headers/clone_headers.sh | 11 ----------- modules/Vulkan-Headers/meson.build | 12 ------------ src/meson.build | 2 +- subprojects/vulkanheaders.wrap | 10 ++++++++++ 6 files changed, 18 insertions(+), 27 deletions(-) delete mode 100755 modules/Vulkan-Headers/clone_headers.sh delete mode 100644 modules/Vulkan-Headers/meson.build create mode 100644 subprojects/vulkanheaders.wrap diff --git a/.gitignore b/.gitignore index d293d515..e15b6bc7 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,7 @@ lib32-mangohud*.tar.* *.out *.app +# subprojects +subprojects/packagecache/ +subprojects/imgui-*/ +subprojects/Vulkan-Headers-*/ diff --git a/meson.build b/meson.build index 70968c90..c183eef3 100644 --- a/meson.build +++ b/meson.build @@ -188,15 +188,15 @@ else endif if dep_vulkan.found() - vulkan_headers = [] datadir = get_option('datadir') if not datadir.startswith('/') datadir = get_option('prefix') / datadir endif vk_api_xml = files(datadir / 'vulkan/registry/vk.xml') else - subdir('modules/Vulkan-Headers') - vulkan_headers = vk_api_xml + vkh_sp = subproject('vulkanheaders') + vk_api_xml = vkh_sp.get_variable('vulkan_api_xml') + dep_vulkan = vkh_sp.get_variable('vulkanheaders_dep') endif vk_enum_to_str = custom_target( diff --git a/modules/Vulkan-Headers/clone_headers.sh b/modules/Vulkan-Headers/clone_headers.sh deleted file mode 100755 index 5ae20a59..00000000 --- a/modules/Vulkan-Headers/clone_headers.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -GIT="$1" -BUILD_DIR="$2" - -if [ ! -f "$BUILD_DIR/registry/vk.xml" ]; then - "$GIT" clone --depth 1 https://github.com/KhronosGroup/Vulkan-Headers.git "$BUILD_DIR" -fi - -ln -sf "registry/vk.xml" modules/Vulkan-Headers/ -ln -sf "include/vulkan" modules/Vulkan-Headers/ diff --git a/modules/Vulkan-Headers/meson.build b/modules/Vulkan-Headers/meson.build deleted file mode 100644 index da666de8..00000000 --- a/modules/Vulkan-Headers/meson.build +++ /dev/null @@ -1,12 +0,0 @@ -prog_git = find_program('git') -prog_sh = find_program('sh') -script_clone_hdrs = files('clone_headers.sh') - -vk_api_xml = custom_target( - 'vk_api_xml', - input : [], - output : ['vk.xml'], # because output can't have segments, link vk.xml to this subdir dir in build prefix - command : [ - prog_sh, script_clone_hdrs, prog_git, meson.current_build_dir() - ], -) diff --git a/src/meson.build b/src/meson.build index 2f1704c4..08d6107d 100644 --- a/src/meson.build +++ b/src/meson.build @@ -158,7 +158,7 @@ vklayer_mesa_overlay = shared_library( vklayer_files, opengl_files, overlay_spv, - vulkan_headers, + vk_enum_to_str, c_args : [ pre_args, c_vis_args, diff --git a/subprojects/vulkanheaders.wrap b/subprojects/vulkanheaders.wrap new file mode 100644 index 00000000..0684e947 --- /dev/null +++ b/subprojects/vulkanheaders.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = Vulkan-Headers-1.2.136 + +source_url = https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.136.tar.gz +source_filename = vulkanheaders-1.2.136.tar.gz +source_hash = d67e61ade037906d76ae4f1a6d5adf38008b30783774a5957a84527f3a5ebdb4 + +patch_url = https://github.com/stephanlachnit/vulkanheaders-wrap/releases/download/v1.2.136/v1.2.136.zip +patch_filename = vulkanheaders-1.2.136-wrap.zip +patch_hash = 4b0e8ba1f37458b660f4d3ed3f5259ca5b0bd46ef309cc3ccaf22a2a203bda49