[Mesa-dev] [PATCH mesa 2/6] meson: dedup gallium-xvmc logic

Eric Engestrom eric.engestrom at imgtec.com
Thu Dec 7 16:52:18 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 d8f317e1aaf350c26687..08c9c4b92313e97f0eb1 100644
--- a/meson.build
+++ b/meson.build
@@ -404,34 +404,32 @@ if vdpau_drivers_path == ''
   vdpau_drivers_path = join_paths(get_option('libdir'), 'vdpau')
 endif
 
-dep_xvmc = []
 _xvmc = get_option('gallium-xvmc')
-if _xvmc == 'auto'
-  if not ['linux', 'bsd'].contains(host_machine.system())
-    with_gallium_xvmc = false
-  elif not with_platform_x11
-    with_gallium_xvmc = false
-  elif not (with_gallium_r600 or with_gallium_nouveau)
-    with_gallium_xvmc = false
-  else
-    dep_xvmc = dependency('xvmc', version : '>= 1.0.6', required : false)
-    with_gallium_xvmc = dep_xvmc.found()
-  endif
-elif _xvmc == 'true'
-  if not ['linux', 'bsd'].contains(host_machine.system())
+if not ['linux', 'bsd'].contains(host_machine.system())
+  if _xvmc == 'true'
     error('XVMC state tracker can only be build on unix-like OSes.')
-  elif not with_platform_x11
+  else
+    _xvmc = 'false'
+  endif
+elif not with_platform_x11
+  if _xvmc == 'true'
     error('XVMC state tracker requires X11 support.')
-    with_gallium_xvmc = false
-  elif not (with_gallium_r600 or with_gallium_nouveau)
+  else
+    _xvmc = 'false'
+  endif
+elif not (with_gallium_r600 or with_gallium_nouveau)
+  if _xvmc == 'true'
     error('XVMC state tracker requires at least one of the following gallium drivers: r600, nouveau.')
+  else
+    _xvmc = 'false'
   endif
-  dep_xvmc = dependency('xvmc', version : '>= 1.0.6')
-  with_gallium_xvmc = true
-else
-  with_gallium_xvmc = false
+elif _xvmc == 'auto'
+  _xvmc = 'true'
 endif
+with_gallium_xvmc = _xvmc == 'true'
+dep_xvmc = []
 if with_gallium_xvmc
+  dep_xvmc = dependency('xvmc', version : '>= 1.0.6')
   dep_xvmc = declare_dependency(
     compile_args : dep_xvmc.get_pkgconfig_variable('cflags').split()
   )
-- 
Cheers,
  Eric



More information about the mesa-dev mailing list