From 6064e5087eb2dfaeab5157d6c7c7c58366844d69 Mon Sep 17 00:00:00 2001 From: columbarius Date: Sun, 15 Oct 2023 17:24:08 +0200 Subject: [PATCH] build: Restructure vulkan dependency handling and assert headers vulkan_headers was a workaround for distributions providing pkg-config information without the headers. Replacing it with a more conventional have_vulkan and assert header availability if the option vulkan is enabled. --- spa/meson.build | 11 ++++++++--- spa/plugins/meson.build | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/spa/meson.build b/spa/meson.build index e9c97a652..31c1c41b0 100644 --- a/spa/meson.build +++ b/spa/meson.build @@ -87,9 +87,14 @@ if get_option('spa-plugins').allowed() endif jack_dep = dependency('jack', version : '>= 1.9.10', required: get_option('jack')) summary({'JACK2': jack_dep.found()}, bool_yn: true, section: 'Backend') - vulkan_dep = dependency('vulkan', disabler : true, version : '>= 1.1.69', required: get_option('vulkan')) - vulkan_headers = cc.has_header('vulkan/vulkan.h', dependencies : vulkan_dep) - #summary({'Vulkan': vulkan_headers}, bool_yn: true, section: 'Misc dependencies') + + have_vulkan = false + vulkan_dep = dependency('vulkan', version : '>= 1.1.69', required: get_option('vulkan')) + if vulkan_dep.found() + have_vulkan = cc.has_header('vulkan/vulkan.h', dependencies : vulkan_dep) + assert((not get_option('vulkan').enabled()) or have_vulkan, 'Vulkan headers are missing') + endif + summary({'Vulkan': have_vulkan}, bool_yn: true, section: 'Misc dependencies') libcamera_dep = dependency('libcamera', required: get_option('libcamera')) summary({'libcamera': libcamera_dep.found()}, bool_yn: true, section: 'Backend') diff --git a/spa/plugins/meson.build b/spa/plugins/meson.build index d0364fa0a..210004691 100644 --- a/spa/plugins/meson.build +++ b/spa/plugins/meson.build @@ -40,7 +40,7 @@ endif if get_option('volume').allowed() subdir('volume') endif -if vulkan_headers +if have_vulkan subdir('vulkan') endif