broadcom/vc5: Fix a segfault on mix of booleans.
[mesa.git] / meson.build
index 94c9bdc2bbcbf72391a12fa49edd321abd2ee9ab..80ea60ffa7d915654a8980112ec33167bd9e3eb2 100644 (file)
@@ -503,34 +503,32 @@ if with_gallium_omx
   )
 endif
 
-dep_va = []
 _va = get_option('gallium-va')
-if _va == 'auto'
-  if not system_has_kms_drm
-    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
+if not system_has_kms_drm
+  if _va == 'true'
+    error('VA state tracker can only be built on unix-like OSes.')
   else
-    dep_va = dependency('libva', version : '>= 0.38.0', required : false)
-    with_gallium_va = dep_va.found()
+    _va = 'false'
   endif
-elif _va == 'true'
-  if not system_has_kms_drm
-    error('VA state tracker can only be built on DRM/KMS OSes.')
-  elif not (with_platform_x11 or with_platform_drm)
+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 : run_command(prog_pkgconfig, ['libva', '--cflags']).stdout().split()
   )
@@ -542,26 +540,21 @@ if va_drivers_path == ''
 endif
 
 _xa = get_option('gallium-xa')
-if _xa == 'auto'
-  if not system_has_kms_drm
-    with_gallium_xa = false
-  elif not (with_gallium_nouveau or with_gallium_freedreno or with_gallium_i915
-            or with_gallium_svga)
-    with_gallium_xa = false
+if not system_has_kms_drm
+  if _xa == 'true'
+    error('XA state tracker can only be built on unix-like OSes.')
   else
-    with_gallium_xa = true
+    _xa = 'false'
   endif
-elif _xa == 'true'
-  if not system_has_kms_drm
-    error('XA state tracker can only be built on DRM/KMS OSes.')
-  elif not (with_gallium_nouveau or with_gallium_freedreno or with_gallium_i915
-            or with_gallium_svga)
+elif not (with_gallium_nouveau or with_gallium_freedreno or with_gallium_i915
+          or with_gallium_svga)
+  if _xa == 'true'
     error('XA state tracker requires at least one of the following gallium drivers: nouveau, freedreno, i915, svga.')
+  else
+    _xa = 'false'
   endif
-  with_gallium_xa = true
-else
-  with_gallium_xa = false
 endif
+with_gallium_xa = _xa != 'false'
 
 d3d_drivers_path = get_option('d3d-drivers-path')
 if d3d_drivers_path == ''