meson: Add option to use system vulkan headers

pull/41/head
Danilo Spinella 4 years ago committed by jackun
parent 2c6f9d0d44
commit 18edd4eb50

@ -108,9 +108,15 @@ endif
inc_common = [
include_directories('include'),
include_directories('modules/Vulkan-Headers/include'),
]
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
c_args = []
foreach a : ['-Werror=implicit-function-declaration',
@ -184,7 +190,16 @@ endif
dep_pthread = cc.find_library('pthread')
vk_api_xml = files('modules/Vulkan-Headers/registry/vk.xml')
if dep_vulkan.found()
datadir = get_option('datadir')
if not datadir.startswith('/')
datadir = get_option('prefix') / datadir
endif
vk_api_xml = files(datadir / 'vulkan/registry/vk.xml')
else
vk_api_xml = files('modules/Vulkan-Headers/registry/vk.xml')
endif
vk_layer_table_helpers = []
vk_enum_to_str = custom_target(

@ -1 +1,2 @@
option('glibcxx_asserts', type : 'boolean', value : false)
option('use_system_vulkan', type : 'feature', value : 'disabled', description: 'Use system vulkan headers instead of the provided ones')

@ -66,7 +66,8 @@ vklayer_mesa_overlay = shared_library(
vulkan_wsi_deps,
libimgui_core_dep,
dep_dl,
dep_pthread],
dep_pthread,
dep_vulkan],
include_directories : inc_common,
link_args : cc.get_supported_link_arguments(['-Wl,-Bsymbolic-functions', '-Wl,-z,relro']),
install : true

Loading…
Cancel
Save