meson: wayland: move dep checks to the lib
authorMatthew Waters <matthew@centricular.com>
Thu, 17 Nov 2016 04:15:18 +0000 (15:15 +1100)
committerMatthew Waters <matthew@centricular.com>
Thu, 17 Nov 2016 04:16:18 +0000 (15:16 +1100)
Moves them closer to where they are used.  We don't want every check in
the main meson.build file.

gst-libs/gst/meson.build
gst-libs/gst/wayland/meson.build
meson.build

index b5e4572..2ea25bc 100644 (file)
@@ -10,7 +10,5 @@ subdir('interfaces')
 subdir('mpegts')
 subdir('player')
 subdir('video')
-if use_wayland
-    subdir('wayland')
-endif
+subdir('wayland')
 subdir('gl')
index 634d2dd..e9a88c9 100644 (file)
@@ -1,13 +1,23 @@
-gstwayland = library('gstwayland-' + api_version,
-  'wayland.c',
-  c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'],
-  include_directories : [configinc, libsinc],
-  version : libversion,
-  soversion : soversion,
-  install : true,
-  dependencies : [gst_dep, gstvideo_dep]
-)
+wl_req = '>= 1.4'
+wl_client_dep = dependency('wayland-client', version: wl_req, required: false)
+libdrm_dep = dependency('libdrm', version: '>= 2.4.55', required: false)
+wl_protocol_dep = dependency('wayland-protocols', version: wl_req,
+                             required: false)
+wl_scanner = find_program('wayland-scanner')
+use_wayland = wl_protocol_dep.found() and wl_client_dep.found() and wl_scanner.found() and libdrm_dep.found()
 
-gstwayland_dep = declare_dependency(link_with : gstwayland,
-  include_directories : [libsinc],
-  dependencies : [gst_dep, gstvideo_dep])
+if use_wayland
+  gstwayland = library('gstwayland-' + api_version,
+    'wayland.c',
+    c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'],
+    include_directories : [configinc, libsinc],
+    version : libversion,
+    soversion : soversion,
+    install : true,
+    dependencies : [gst_dep, gstvideo_dep]
+  )
+
+  gstwayland_dep = declare_dependency(link_with : gstwayland,
+    include_directories : [libsinc],
+    dependencies : [gst_dep, gstvideo_dep])
+endif
index 4c7bac8..04ba441 100644 (file)
@@ -331,16 +331,6 @@ else
   cdata.set('DISABLE_ORC', 1)
 endif
 
-# Wayland checks
-
-wl_req = '>= 1.4'
-wl_client_dep = dependency('wayland-client', version: wl_req, required: false)
-libdrm_dep = dependency('libdrm', version: '>= 2.4.55', required: false)
-wl_protocol_dep = dependency('wayland-protocols', version: wl_req,
-                             required: false)
-wl_scanner = find_program('wayland-scanner')
-use_wayland = wl_protocol_dep.found() and wl_client_dep.found() and wl_scanner.found() and libdrm_dep.found()
-
 configure_file(input : 'config.h.meson',
   output : 'config.h',
   configuration : cdata)