mirror of
https://github.com/flightlessmango/MangoHud.git
synced 2024-10-31 15:20:13 +00:00
Clone vulkan headers if needed
This commit is contained in:
parent
18edd4eb50
commit
70d0e81c36
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,6 +1,3 @@
|
|||||||
[submodule "modules/ImGui/src"]
|
[submodule "modules/ImGui/src"]
|
||||||
path = modules/ImGui/src
|
path = modules/ImGui/src
|
||||||
url = https://github.com/flightlessmango/ImGui.git
|
url = https://github.com/flightlessmango/ImGui.git
|
||||||
[submodule "modules/Vulkan-Headers"]
|
|
||||||
path = modules/Vulkan-Headers
|
|
||||||
url = https://github.com/KhronosGroup/Vulkan-Headers.git
|
|
||||||
|
11
meson.build
11
meson.build
@ -111,11 +111,6 @@ inc_common = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
dep_vulkan = dependency('vulkan', required: get_option('use_system_vulkan'))
|
dep_vulkan = dependency('vulkan', required: get_option('use_system_vulkan'))
|
||||||
if not dep_vulkan.found()
|
|
||||||
inc_common += [
|
|
||||||
include_directories('modules/Vulkan-Headers/include')
|
|
||||||
]
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Check for generic C arguments
|
# Check for generic C arguments
|
||||||
c_args = []
|
c_args = []
|
||||||
@ -191,17 +186,17 @@ endif
|
|||||||
dep_pthread = cc.find_library('pthread')
|
dep_pthread = cc.find_library('pthread')
|
||||||
|
|
||||||
if dep_vulkan.found()
|
if dep_vulkan.found()
|
||||||
|
vulkan_headers = []
|
||||||
datadir = get_option('datadir')
|
datadir = get_option('datadir')
|
||||||
if not datadir.startswith('/')
|
if not datadir.startswith('/')
|
||||||
datadir = get_option('prefix') / datadir
|
datadir = get_option('prefix') / datadir
|
||||||
endif
|
endif
|
||||||
vk_api_xml = files(datadir / 'vulkan/registry/vk.xml')
|
vk_api_xml = files(datadir / 'vulkan/registry/vk.xml')
|
||||||
else
|
else
|
||||||
vk_api_xml = files('modules/Vulkan-Headers/registry/vk.xml')
|
subdir('modules/Vulkan-Headers')
|
||||||
|
vulkan_headers = vk_api_xml
|
||||||
endif
|
endif
|
||||||
|
|
||||||
vk_layer_table_helpers = []
|
|
||||||
|
|
||||||
vk_enum_to_str = custom_target(
|
vk_enum_to_str = custom_target(
|
||||||
'vk_enum_to_str',
|
'vk_enum_to_str',
|
||||||
input : ['bin/gen_enum_to_str.py', vk_api_xml],
|
input : ['bin/gen_enum_to_str.py', vk_api_xml],
|
||||||
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 7264358702061d3ed819d62d3d6fd66ab1da33c3
|
|
11
modules/Vulkan-Headers/clone_headers.sh
Executable file
11
modules/Vulkan-Headers/clone_headers.sh
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/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/
|
12
modules/Vulkan-Headers/meson.build
Normal file
12
modules/Vulkan-Headers/meson.build
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
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()
|
||||||
|
],
|
||||||
|
)
|
@ -50,7 +50,7 @@ vklayer_mesa_overlay = shared_library(
|
|||||||
vk_enum_to_str,
|
vk_enum_to_str,
|
||||||
vklayer_files,
|
vklayer_files,
|
||||||
overlay_spv,
|
overlay_spv,
|
||||||
vk_layer_table_helpers,
|
vulkan_headers,
|
||||||
c_args : [
|
c_args : [
|
||||||
pre_args,
|
pre_args,
|
||||||
c_vis_args,
|
c_vis_args,
|
||||||
|
Loading…
Reference in New Issue
Block a user