[Mesa-dev] [PATCH 17/20] meson: add option to disable LLVM

Dylan Baker dylan at pnwbakers.com
Wed Oct 11 17:41:25 UTC 2017


Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 meson.build       | 5 ++++-
 meson_options.txt | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 5684a5666d9..9138dc2f5b5 100644
--- a/meson.build
+++ b/meson.build
@@ -38,6 +38,7 @@ with_vulkan_icd_dir = get_option('vulkan-icd-dir')
 with_tests = get_option('build-tests')
 with_valgrind = get_option('valgrind')
 with_asm = get_option('asm')
+with_llvm = get_option('llvm')
 if get_option('texture-float')
   pre_args += '-DTEXTURE_FLOAT_ENABLED'
   message('WARNING: Floating-point texture enabled. Please consult docs/patents.txt and your lawyer before building mesa.')
@@ -563,7 +564,7 @@ endif
 dep_llvm = dependency(
   'llvm', version : '>= 3.9.0', required : with_amd_vk, modules : llvm_modules,
 )
-if dep_llvm.found()
+if dep_llvm.found() and with_llvm
   _llvm_version = dep_llvm.version().split('.')
   # Development versions of LLVM have an 'svn' suffix, we don't want that for
   # our version checks. This is fixed in 0.43.0
@@ -575,6 +576,8 @@ if dep_llvm.found()
     '-DHAVE_LLVM=0x0 at 0@@1@@2@'.format(_llvm_version[0], _llvm_version[1], _llvm_patch),
     '-DMESA_LLVM_VERSION_PATCH=@0@'.format(_llvm_patch),
   ]
+elif with_amd_vk or with_gallium_radeonsi # etc
+  error('The following drivers require LLVM: Radv, RadeonSi; but it was not found or disabled.')
 endif
 
 dep_glvnd = []
diff --git a/meson_options.txt b/meson_options.txt
index 15476936b20..d29b12e5959 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -52,6 +52,7 @@ option('glvnd', type : 'boolean', value : false,
        description : 'Enable GLVND support.')
 option('asm', type : 'boolean', value : true,
        description : 'Build assembly code if possible')
+option('llvm', type : 'boolean', value : true, description : 'Build with LLVM support.')
 option('valgrind', type : 'boolean', value : true,
        description : 'Build with valgrind support if possible')
 option('build-tests', type : 'boolean', value : false,
-- 
2.14.2



More information about the mesa-dev mailing list