[Mesa-dev] [PATCH mesa 4/6] meson: dedup gallium-va logic

Eric Engestrom eric.engestrom at imgtec.com
Thu Dec 7 16:52:20 UTC 2017


Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
---
 meson.build | 40 +++++++++++++++++++---------------------
 1 file changed, 19 insertions(+), 21 deletions(-)

diff --git a/meson.build b/meson.build
index 1917b474b1ff4505651a..5a957ad13d1b39b5f709 100644
--- a/meson.build
+++ b/meson.build
@@ -498,34 +498,32 @@ if with_gallium_omx
   )
 endif
 
-dep_va = []
 _va = get_option('gallium-va')
-if _va == 'auto'
-  if not ['linux', 'bsd'].contains(host_machine.system())
-    with_gallium_va = false
-  elif not with_platform_x11
-    with_gallium_va = false
-  elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
-    with_gallium_va = false
-  else
-    dep_va = dependency('libva', version : '>= 0.38.0', required : false)
-    with_gallium_va = dep_va.found()
-  endif
-elif _va == 'true'
-  if not ['linux', 'bsd'].contains(host_machine.system())
+if not ['linux', 'bsd'].contains(host_machine.system())
+  if _va == 'true'
     error('VA state tracker can only be built on unix-like OSes.')
-  elif not (with_platform_x11 or with_platform_drm)
+  else
+    _va = 'false'
+  endif
+elif not (with_platform_x11 or with_platform_drm)
+  if _va == 'true'
     error('VA state tracker requires X11 or drm or wayland platform support.')
-    with_gallium_va = false
-  elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
+  else
+    _va = 'false'
+  endif
+elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
+  if _va == 'true'
     error('VA state tracker requires at least one of the following gallium drivers: r600, radeonsi, nouveau.')
+  else
+    _va = 'false'
   endif
-  dep_va = dependency('libva', version : '>= 0.38.0')
-  with_gallium_va = true
-else
-  with_gallium_va = false
+elif _va == 'auto'
+  _va = 'true'
 endif
+with_gallium_va = _va == 'true'
+dep_va = []
 if with_gallium_va
+  dep_va = dependency('libva', version : '>= 0.38.0')
   dep_va = declare_dependency(
     compile_args : dep_va.get_pkgconfig_variable('cflags').split()
   )
-- 
Cheers,
  Eric



More information about the mesa-dev mailing list