build: add headers to declare_dependency() sources

Before the dependency is usable, enum headers need to be built.
Fixes missing header files when wayland-protocols is used as a
subproject.

Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
Simon Ser 2025-08-16 19:15:11 +02:00
parent ec65e4366b
commit 57c78b9b8a
2 changed files with 3 additions and 1 deletions

View file

@ -1,7 +1,7 @@
header_install_dir = get_option('includedir') / 'wayland-protocols'
foreach protocol_file : protocol_files
header_name = fs.name(protocol_file).replace('.xml', '-enum.h')
custom_target(
headers += custom_target(
header_name,
output: header_name,
input: '../..' / protocol_file,

View file

@ -151,6 +151,7 @@ foreach protocol_file : installed_protocol_files
endforeach
include_dirs = []
headers = []
if dep_scanner.version().version_compare('>=1.22.90')
subdir('include/wayland-protocols')
include_dirs = ['include']
@ -185,6 +186,7 @@ wayland_protocols = declare_dependency(
variables: {
'pkgdatadir': wayland_protocols_srcdir,
},
sources: headers,
)
meson.override_dependency('wayland-protocols', wayland_protocols)