[Spice-devel] [PATCH spice-gtk v2 07/15] meson: switch usbredir option to auto feature

Frediano Ziglio fziglio at redhat.com
Wed Jan 9 10:09:27 UTC 2019


From: Marc-André Lureau <marcandre.lureau at redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
---
 .gitlab-ci.yml    |  1 -
 meson.build       | 15 +++++----------
 meson_options.txt |  3 +--
 3 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c956adda..750e801d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -45,7 +45,6 @@ makecheck_simple:
 makecheck_simple-meson:
   script:
   - meson build -Dauto_features=disabled
-                -Dusbredir=false
                 -Ddbus=false || (cat build/meson-logs/meson-log.txt && exit 1)
   - ninja -C build
   - (cd build && meson test) || (cat build/meson-logs/testlog.txt && exit 1)
diff --git a/meson.build b/meson.build
index e1e5e919..7eff9ae2 100644
--- a/meson.build
+++ b/meson.build
@@ -175,16 +175,11 @@ endif
 
 # usbredir
 spice_gtk_has_usbredir = false
-if get_option('usbredir')
-  deps = {'libusbredirparser-0.5': '>= 0.5',
-          'libusbredirhost' : '>= 0.4.2',
-          'libusb-1.0' : '>= 1.0.16'}
-
-  foreach dep, version : deps
-    usb_dep = dependency(dep, version : version)
-    spice_glib_deps += usb_dep
-  endforeach
-
+d1 = dependency('libusbredirparser-0.5', required : get_option('usbredir'))
+d2 = dependency('libusbredirhost', version : '>= 0.4.2', required : get_option('usbredir'))
+d3 = dependency('libusb-1.0', version : '>= 1.0.16', required : get_option('usbredir'))
+if d1.found() and d2.found() and d3.found()
+  spice_glib_deps += [d1, d2, d3]
   spice_gtk_config_data.set('USE_USBREDIR', '1')
   spice_gtk_has_usbredir = true
 endif
diff --git a/meson_options.txt b/meson_options.txt
index 8ac6c684..6631e1c1 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -16,8 +16,7 @@ option('builtin-mjpeg',
     description : 'Enable the builtin mjpeg video decoder')
 
 option('usbredir',
-    type : 'boolean',
-    value : true,
+    type : 'feature',
     description : 'Enable usbredir support')
 
 option('polkit',
-- 
2.20.1



More information about the Spice-devel mailing list