meson: use proper handling of wayland-protocols dependency
authorEli Schwartz <eschwartz@archlinux.org>
Thu, 10 Mar 2022 05:08:36 +0000 (00:08 -0500)
committerJordan Petridis <jordan@centricular.com>
Thu, 17 Mar 2022 10:54:58 +0000 (12:54 +0200)
Ensure that resolution of the subproject occurs via the dependency
interface, not the "poke at subprojects manually" interface, and make
that actually work via --wrap-mode=forcefallback.

There's no need to mark it as not-required and then manually invoke
subproject(), since fallback should work correctly and it is always
needed.

However, if fallback was performed (or forced) it would error out since
get_variable() was instructed to only use pkg-config while the relevant
variable was exported by the subproject as an internal fallback
dependency.

meson.build

index 63b4d73bfe308600ac838f61654b5d10e0041731..17fdb1cfe7f455e615eb55a56c1b962323a481a5 100644 (file)
@@ -517,15 +517,11 @@ if wayland_enabled
   wlclientdep    = dependency('wayland-client', version:  wayland_req,
                               fallback: 'wayland',
                               default_options: ['documentation=false'])
-  wlprotocolsdep = dependency('wayland-protocols', version: wayland_proto_req, required: false)
+  wlprotocolsdep = dependency('wayland-protocols', version: wayland_proto_req)
   wlegldep       = dependency('wayland-egl',
                               fallback: 'wayland')
 
-  if not wlprotocolsdep.found()
-    wlproto_dir = subproject('wayland-protocols').get_variable('wayland_protocols_srcdir')
-  else
-    wlproto_dir = wlprotocolsdep.get_variable(pkgconfig: 'pkgdatadir')
-  endif
+  wlproto_dir = wlprotocolsdep.get_variable('pkgdatadir')
 
   wayland_pkgs = [
     'wayland-client @0@'.format(wayland_req),