[Mesa-dev] [PATCH mesa 3/6] meson: dedup gallium-omx logic

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


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

diff --git a/meson.build b/meson.build
index 08c9c4b92313e97f0eb1..1917b474b1ff4505651a 100644
--- a/meson.build
+++ b/meson.build
@@ -440,32 +440,32 @@ if xvmc_drivers_path == ''
   xvmc_drivers_path = get_option('libdir')
 endif
 
-dep_omx = []
 _omx = get_option('gallium-omx')
-if _omx == 'auto'
-  if not ['linux', 'bsd'].contains(host_machine.system())
-    with_gallium_omx = false
-  elif not with_platform_x11
-    with_gallium_omx = false
-  elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
-    with_gallium_omx = false
-  else
-    dep_omx = dependency('libomxil-bellagio', required : false)
-    with_gallium_omx = dep_omx.found()
-  endif
-elif _omx == 'true'
-  if not ['linux', 'bsd'].contains(host_machine.system())
+if not ['linux', 'bsd'].contains(host_machine.system())
+  if _omx == 'true'
     error('OMX state tracker can only be built on unix-like OSes.')
-  elif not (with_platform_x11 or with_platform_drm)
+  else
+    _omx = 'false'
+  endif
+elif not (with_platform_x11 or with_platform_drm)
+  if _omx == 'true'
     error('OMX state tracker requires X11 or drm platform support.')
-    with_gallium_omx = false
-  elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
+  else
+    _omx = 'false'
+  endif
+elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
+  if _omx == 'true'
     error('OMX state tracker requires at least one of the following gallium drivers: r600, radeonsi, nouveau.')
+  else
+    _omx = 'false'
   endif
+elif _omx == 'auto'
+  _omx = 'true'
+endif
+with_gallium_omx = _omx == 'true'
+dep_omx = []
+if with_gallium_omx
   dep_omx = dependency('libomxil-bellagio')
-  with_gallium_omx = true
-else
-  with_gallium_omx = false
 endif
 
 omx_drivers_path = get_option('omx-libs-path')
-- 
Cheers,
  Eric



More information about the mesa-dev mailing list