aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-04-30 16:25:46 -0700
committerDylan Baker <dylan@pnwbakers.com>2019-05-13 11:22:31 -0700
commit5fb64b0cfa48daf7f2c412ee8e851fa29f2ef1a3 (patch)
tree5486e673dc682519da29bb80a054e9d21409af48 /mesonbuild/compilers/compilers.py
parent7d0e0d6f6e7aa08a84aa2e5efb086bd45f364d00 (diff)
downloadmeson-5fb64b0cfa48daf7f2c412ee8e851fa29f2ef1a3.zip
meson-5fb64b0cfa48daf7f2c412ee8e851fa29f2ef1a3.tar.gz
meson-5fb64b0cfa48daf7f2c412ee8e851fa29f2ef1a3.tar.bz2
compilers: Split msvc version code into helper
ICL needs ot use some of this code, but not from it's own version information.
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r--mesonbuild/compilers/compilers.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index ff443b3..653e368 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -1788,16 +1788,7 @@ class VisualStudioLikeCompiler(metaclass=abc.ABCMeta):
return None
return vs32_instruction_set_args.get(instruction_set, None)
- def get_toolset_version(self):
- if self.id == 'clang-cl':
- # I have no idea
- return '14.1'
-
- # See boost/config/compiler/visualc.cpp for up to date mapping
- try:
- version = int(''.join(self.version.split('.')[0:2]))
- except ValueError:
- return None
+ def _calculate_toolset_version(self, version: int) -> Optional[str]:
if version < 1310:
return '7.0'
elif version < 1400:
@@ -1821,6 +1812,18 @@ class VisualStudioLikeCompiler(metaclass=abc.ABCMeta):
mlog.warning('Could not find toolset for version {!r}'.format(self.version))
return None
+ def get_toolset_version(self):
+ if self.id == 'clang-cl':
+ # I have no idea
+ return '14.1'
+
+ # See boost/config/compiler/visualc.cpp for up to date mapping
+ try:
+ version = int(''.join(self.version.split('.')[0:2]))
+ except ValueError:
+ return None
+ return self._calculate_toolset_version(version)
+
def get_default_include_dirs(self):
if 'INCLUDE' not in os.environ:
return []