summaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-02-20 07:20:18 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-02-21 01:36:08 +0530
commit69e83d6aed89745bad540295e4a93ef37265e1b3 (patch)
treed8ab0f3f1a9481e9f22bd38884c42b52290b5b3a /mesonbuild/environment.py
parent003e0a0610582020d1b213e0c8d16fe63bc6eabe (diff)
downloadmeson-69e83d6aed89745bad540295e4a93ef37265e1b3.tar.gz
Support passing of options to compilers and linkers
If you pass options, the last element in the array won't be the compiler basename, so just check if the basename is in the exelist somewhere. Includes a test.
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index fe89f0eba..b184b3fc6 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -407,8 +407,7 @@ class Environment:
if isinstance(compiler, str):
compiler = [compiler]
try:
- basename = os.path.basename(compiler[-1]).lower()
- if basename == 'cl' or basename == 'cl.exe':
+ if 'cl' in compiler or 'cl.exe' in compiler:
arg = '/?'
else:
arg = '--version'
@@ -657,8 +656,7 @@ class Environment:
linker = [self.vs_static_linker]
else:
linker = [self.default_static_linker]
- basename = os.path.basename(linker[-1]).lower()
- if basename == 'lib' or basename == 'lib.exe':
+ if 'lib' in linker or 'lib.exe' in linker:
arg = '/?'
else:
arg = '--version'