build: declare dependency for use as a subproject

This allows clients and compositors to easily use wayland-protocols
as a Meson subproject.

Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
Simon Ser 2021-04-15 10:06:47 +02:00 committed by Jonas Ådahl
parent 62e862fac4
commit 26843d6155

View file

@ -1,6 +1,6 @@
project('wayland-protocols', project('wayland-protocols',
version: '1.21', version: '1.21',
meson_version: '>= 0.53.0', meson_version: '>= 0.54.0',
license: 'MIT/Expat', license: 'MIT/Expat',
) )
@ -107,6 +107,14 @@ configure_file(
configuration: pkgconfig_configuration, configuration: pkgconfig_configuration,
) )
wayland_protocols = declare_dependency(
variables: {
'pkgdatadir': wayland_protocols_srcdir,
},
)
meson.override_dependency('wayland-protocols', wayland_protocols)
if get_option('tests') if get_option('tests')
subdir('tests') subdir('tests')
endif endif