From: Daniel Stone Date: Tue, 14 Apr 2020 16:41:00 +0000 (+0100) Subject: meson: Make shared-llvm into a tri-state boolean X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9ecd9463de6ba7a9f0648da16ef9371dd8a202f0;p=mesa.git meson: Make shared-llvm into a tri-state boolean 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 Suggested-by: Dylan Baker Reviewed-by: Dylan Baker Reviewed-by: Jose Fonseca Reviewed-by: Alyssa Rosenzweig Part-of: --- diff --git a/meson.build b/meson.build index cb275e7dcc1..6b85c9540e8 100644 --- a/meson.build +++ b/meson.build @@ -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 diff --git a/meson_options.txt b/meson_options.txt index a39596a6f19..a342354acfc 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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',