Mesa (master): meson: Make shared-llvm into a tri-state boolean

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 16 12:39:32 UTC 2020


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

Author: Daniel Stone <daniels at collabora.com>
Date:   Tue Apr 14 17:41:00 2020 +0100

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 <daniels at collabora.com>
Suggested-by: Dylan Baker <dylan at pnwbakers.com>
Reviewed-by: Dylan Baker <dylan at pnwbakers.com>
Reviewed-by: Jose Fonseca <jfonseca at vmware.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4555>

---

 meson.build       | 5 +++++
 meson_options.txt | 7 ++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

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',



More information about the mesa-commit mailing list