meson: Fix auto option for va
authorDylan Baker <dylan@pnwbakers.com>
Thu, 21 Jun 2018 15:35:03 +0000 (08:35 -0700)
committerDylan Baker <dylan@pnwbakers.com>
Fri, 22 Jun 2018 16:51:25 +0000 (09:51 -0700)
The same as the previous two patches, but for the libva state tracker.

Fixes: 724916c8a84b5bba8f880f17da936585d52c97b6
       ("meson: dedup gallium-xvmc logic")
Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
meson.build

index 82e2b535254228d0459b1cbd1efc634b0498ec45..e88616c9e82a9f45245c410e14d66e5e0cc27f53 100644 (file)
@@ -559,13 +559,16 @@ elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
 elif _va == 'auto'
   _va = 'true'
 endif
-with_gallium_va = _va == 'true'
+with_gallium_va = false
 dep_va = null_dep
-if with_gallium_va
-  dep_va = dependency('libva', version : '>= 0.39.0')
-  dep_va_headers = declare_dependency(
-    compile_args : run_command(prog_pkgconfig, ['libva', '--cflags']).stdout().split()
-  )
+if _va != 'false'
+  dep_va = dependency('libva', version : '>= 0.38.0', required : _va == 'true')
+  if dep_va.found()
+    dep_va_headers = declare_dependency(
+      compile_args : run_command(prog_pkgconfig, ['libva', '--cflags']).stdout().split()
+    )
+    with_gallium_va = true
+  endif
 endif
 
 va_drivers_path = get_option('va-libs-path')