aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-10-08 18:14:01 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2018-11-04 15:42:06 +0000
commit2993fc4e8a9dcd78d581277f7100bc68d603fd5d (patch)
treefc30dc96d994d88960c567187494434fede67050 /mesonbuild
parenta025c98d3082806321f53c4dfae9c738d1dc1584 (diff)
downloadmeson-2993fc4e8a9dcd78d581277f7100bc68d603fd5d.zip
meson-2993fc4e8a9dcd78d581277f7100bc68d603fd5d.tar.gz
meson-2993fc4e8a9dcd78d581277f7100bc68d603fd5d.tar.bz2
Use llvm-lib as an alternative to lib
Detect llvm-lib as an alternative Windows static linker to lib
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/environment.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index d9de7db..dfed376 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -363,6 +363,7 @@ class Environment:
self.default_rust = ['rustc']
self.default_static_linker = ['ar']
self.vs_static_linker = ['lib']
+ self.clang_cl_static_linker = ['llvm-lib']
self.gcc_static_linker = ['gcc-ar']
self.clang_static_linker = ['llvm-ar']
@@ -919,7 +920,7 @@ This is probably wrong, it should always point to the native compiler.''' % evar
if evar in os.environ:
linkers = [shlex.split(os.environ[evar])]
elif isinstance(compiler, compilers.VisualStudioCCompiler):
- linkers = [self.vs_static_linker]
+ linkers = [self.vs_static_linker, self.clang_cl_static_linker]
elif isinstance(compiler, compilers.GnuCompiler):
# Use gcc-ar if available; needed for LTO
linkers = [self.gcc_static_linker, self.default_static_linker]
@@ -929,14 +930,14 @@ This is probably wrong, it should always point to the native compiler.''' % evar
elif isinstance(compiler, compilers.DCompiler):
# Prefer static linkers over linkers used by D compilers
if mesonlib.is_windows():
- linkers = [self.vs_static_linker, compiler.get_linker_exelist()]
+ linkers = [self.vs_static_linker, self.clang_cl_static_linker, compiler.get_linker_exelist()]
else:
linkers = [self.default_static_linker, compiler.get_linker_exelist()]
else:
linkers = [self.default_static_linker]
popen_exceptions = {}
for linker in linkers:
- if 'lib' in linker or 'lib.exe' in linker:
+ if not set(['lib', 'lib.exe', 'llvm-lib', 'llvm-lib.exe']).isdisjoint(linker):
arg = '/?'
else:
arg = '--version'
@@ -945,7 +946,7 @@ This is probably wrong, it should always point to the native compiler.''' % evar
except OSError as e:
popen_exceptions[' '.join(linker + [arg])] = e
continue
- if '/OUT:' in out or '/OUT:' in err:
+ if '/OUT:' in out.upper() or '/OUT:' in err.upper():
return VisualStudioLinker(linker)
if p.returncode == 0 and ('armar' in linker or 'armar.exe' in linker):
return ArmarLinker(linker)