meson: Make shared-llvm into a tri-state boolean
authorDaniel Stone <daniels@collabora.com>
Tue, 14 Apr 2020 16:41:00 +0000 (17:41 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 16 Apr 2020 12:18:36 +0000 (12:18 +0000)
Choosing LLVM's link mode is legitimate on UNIX systems, but only static
actually really works under Windows.

Give shared-llvm a default 'auto' mode which will pick the previous
default of true (shared) on UNIX systems, but newly defaulting to false
(static) on Windows.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Suggested-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4555>

meson.build
meson_options.txt

index cb275e7dcc19adb7d63b5c1d00f7e049edb8dfef..6b85c9540e846b528a7e88a6bc50a8960f2438a3 100644 (file)
@@ -1401,6 +1401,11 @@ else
 endif
 
 _shared_llvm = get_option('shared-llvm')
+if _shared_llvm == 'auto'
+  _shared_llvm = (host_machine.system() != 'windows')
+else
+  _shared_llvm = (_shared_llvm == 'true')
+endif
 _llvm = get_option('llvm')
 
 # The cmake method will never find libllvm.so|dylib; this is fine for windows
index a39596a6f19d970f9b78f576213a4e8c948abf3b..a342354acfceddf0a1eea9ef7d16f5dea72de689 100644 (file)
@@ -250,9 +250,10 @@ option(
 )
 option(
   'shared-llvm',
-  type : 'boolean',
-  value : true,
-  description : 'Whether to link llvm shared or statically.'
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
+  description : 'Whether to link LLVM shared or statically.'
 )
 option(
   'valgrind',