aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Redelings <benjamin.redelings@gmail.com>2018-02-07 22:04:59 -0500
committerBenjamin Redelings <benjamin.redelings@gmail.com>2018-02-07 22:04:59 -0500
commit47ced35b77c474a7ccf9518c99f52d8b85bc1d01 (patch)
tree16aa12b8cd9c3818b1a6c4952fcb5f1f7a46a9a9
parentf7862bcd92560b2e05c344297c0da895b8292e6a (diff)
downloadmeson-47ced35b77c474a7ccf9518c99f52d8b85bc1d01.zip
meson-47ced35b77c474a7ccf9518c99f52d8b85bc1d01.tar.gz
meson-47ced35b77c474a7ccf9518c99f52d8b85bc1d01.tar.bz2
Don't crash if we are not msvc.
-rw-r--r--mesonbuild/dependencies/misc.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py
index 1d4432a..e720ec5 100644
--- a/mesonbuild/dependencies/misc.py
+++ b/mesonbuild/dependencies/misc.py
@@ -307,13 +307,15 @@ class BoostDependency(ExternalDependency):
def compiler_tag(self):
tag = None
+ compiler = self.env.detect_cpp_compiler(self.want_cross)
if mesonlib.for_windows(self.want_cross, self.env):
- comp_ts_version = self.env.detect_cpp_compiler(self.want_cross).get_toolset_version()
- compiler_ts = comp_ts_version.split('.')
- # FIXME - what about other compilers?
- tag = 'vc{}{}'.format(compiler_ts[0], compiler_ts[1])
-
- tag = '-' + tag
+ if compiler.get_id() == 'msvc':
+ comp_ts_version = compiler.get_toolset_version()
+ compiler_ts = comp_ts_version.split('.')
+ # FIXME - what about other compilers?
+ tag = '-vc{}{}'.format(compiler_ts[0], compiler_ts[1])
+ else:
+ tag = ''
return tag
def threading_tag(self):