aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2019-11-14 22:15:15 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2019-11-16 21:30:36 +0200
commit3a050093a47b79b007d02dd571afe6ec1736ecd2 (patch)
treeaf274a70e82d3601e4047e7c8776f0853a1bdf0f /mesonbuild/environment.py
parent1e7972e9ddbb8a324d0c63c14ced837cb5f940e6 (diff)
downloadmeson-3a050093a47b79b007d02dd571afe6ec1736ecd2.zip
meson-3a050093a47b79b007d02dd571afe6ec1736ecd2.tar.gz
meson-3a050093a47b79b007d02dd571afe6ec1736ecd2.tar.bz2
environment: Only check compiler basename for compiler name
Nix uses absolute paths to compilers in Nix store with Meson. Those store paths contain a hash, which can contain short strings like icl, resulting in incorrectly matching the compiler. https://github.com/NixOS/nixpkgs/issues/73417#issuecomment-554077964
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 072e7c3..f53f17f 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -835,6 +835,8 @@ class Environment:
for compiler in compilers:
if isinstance(compiler, str):
compiler = [compiler]
+ compiler_name = os.path.basename(compiler[0])
+
if not set(['cl', 'cl.exe', 'clang-cl', 'clang-cl.exe']).isdisjoint(compiler):
# Watcom C provides it's own cl.exe clone that mimics an older
# version of Microsoft's compiler. Since Watcom's cl.exe is
@@ -855,11 +857,11 @@ class Environment:
if found_cl in watcom_cls:
continue
arg = '/?'
- elif 'armcc' in compiler[0]:
+ elif 'armcc' in compiler_name:
arg = '--vsn'
- elif 'ccrx' in compiler[0]:
+ elif 'ccrx' in compiler_name:
arg = '-v'
- elif 'icl' in compiler[0]:
+ elif 'icl' in compiler_name:
# if you pass anything to icl you get stuck in a pager
arg = ''
else:
@@ -871,7 +873,7 @@ class Environment:
popen_exceptions[' '.join(compiler + [arg])] = e
continue
- if 'ccrx' in compiler[0]:
+ if 'ccrx' in compiler_name:
out = err
full_version = out.split('\n', 1)[0]