Mesa (master): meson: de-duplicate LLVM check

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Sep 24 20:02:44 UTC 2018


Module: Mesa
Branch: master
Commit: f03a1605922faffa7773ef991d1f3e207aff6afa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f03a1605922faffa7773ef991d1f3e207aff6afa

Author: Dylan Baker <dylan at pnwbakers.com>
Date:   Mon Sep 24 09:32:56 2018 -0700

meson: de-duplicate LLVM check

By adding `_llvm == 'true'` to the required argument we can check the
'auto' and 'true' case in one path.

Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>

---

 meson.build | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/meson.build b/meson.build
index 7a5bcf9004..d098f96d94 100644
--- a/meson.build
+++ b/meson.build
@@ -1189,28 +1189,21 @@ endif
 _shared_llvm = get_option('shared-llvm')
 
 _llvm = get_option('llvm')
-if _llvm == 'auto'
-  dep_llvm = dependency(
-    'llvm',
-    version : _llvm_version,
-    modules : llvm_modules,
-    optional_modules : llvm_optional_modules,
-    required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr or with_gallium_opencl,
-    static : not _shared_llvm
-  )
-  with_llvm = dep_llvm.found()
-elif _llvm == 'true'
+dep_llvm = null_dep
+with_llvm = false
+if _llvm != 'false'
   dep_llvm = dependency(
     'llvm',
     version : _llvm_version,
     modules : llvm_modules,
     optional_modules : llvm_optional_modules,
+    required : (
+      with_amd_vk or with_gallium_radeonsi or with_gallium_swr or
+      with_gallium_opencl or _llvm == 'true'
+    ),
     static : not _shared_llvm,
   )
-  with_llvm = true
-else
-  dep_llvm = null_dep
-  with_llvm = false
+  with_llvm = dep_llvm.found()
 endif
 if with_llvm
   _llvm_version = dep_llvm.version().split('.')




More information about the mesa-commit mailing list