meson: de-duplicate LLVM check
authorDylan Baker <dylan@pnwbakers.com>
Mon, 24 Sep 2018 16:32:56 +0000 (09:32 -0700)
committerDylan Baker <dylan@pnwbakers.com>
Mon, 24 Sep 2018 20:02:07 +0000 (13:02 -0700)
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@intel.com>
meson.build

index 7a5bcf9004b6bf0afa3ccddfc60f9937322dbaef..d098f96d949fb9c03d1cef33de67a23589927852 100644 (file)
@@ -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('.')