[Mesa-dev] [PATCH mesa 1/6] meson: dedup gallium-vdpau logic

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


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

diff --git a/meson.build b/meson.build
index 1ea63fb12915c93a67d5..d8f317e1aaf350c26687 100644
--- a/meson.build
+++ b/meson.build
@@ -364,36 +364,33 @@ if with_dri or with_gallium
   endif
 endif
 
-dep_vdpau = []
 _vdpau = get_option('gallium-vdpau')
-if _vdpau == 'auto'
-  if not ['linux', 'bsd'].contains(host_machine.system())
-    with_gallium_vdpau = false
-  elif not with_platform_x11
-    with_gallium_vdpau = false
-  elif not (with_gallium_r300 or with_gallium_r600 or with_gallium_radeonsi or
-            with_gallium_nouveau)
-    with_gallium_vdpau = false
-  else
-    dep_vdpau = dependency('vdpau', version : '>= 1.1', required : false)
-    with_gallium_vdpau = dep_vdpau.found()
-  endif
-elif _vdpau == 'true'
-  if not ['linux', 'bsd'].contains(host_machine.system())
+if not ['linux', 'bsd'].contains(host_machine.system())
+  if _vdpau == 'true'
     error('VDPAU state tracker can only be build on unix-like OSes.')
-  elif not with_platform_x11
+  else
+    _vdpau = 'false'
+  endif
+elif not with_platform_x11
+  if _vdpau == 'true'
     error('VDPAU state tracker requires X11 support.')
-    with_gallium_vdpau = false
-  elif not (with_gallium_r300 or with_gallium_r600 or with_gallium_radeonsi or
-            with_gallium_nouveau)
+  else
+    _vdpau = 'false'
+  endif
+elif not (with_gallium_r300 or with_gallium_r600 or with_gallium_radeonsi or
+          with_gallium_nouveau)
+  if _vdpau == 'true'
     error('VDPAU state tracker requires at least one of the following gallium drivers: r300, r600, radeonsi, nouveau.')
+  else
+    _vdpau = 'false'
   endif
+elif _vdpau == 'auto'
+  _vdpau = 'true'
+endif
+with_gallium_vdpau = _vdpau == 'true'
+dep_vdpau = []
+if with_gallium_vdpau
   dep_vdpau = dependency('vdpau', version : '>= 1.1')
-  with_gallium_vdpau = true
-else
-  with_gallium_vdpau = false
-endif
-if with_gallium_vdpau
   dep_vdpau = declare_dependency(
     compile_args : dep_vdpau.get_pkgconfig_variable('cflags').split()
   )
-- 
Cheers,
  Eric



More information about the mesa-dev mailing list