From 5fb64b0cfa48daf7f2c412ee8e851fa29f2ef1a3 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 30 Apr 2019 16:25:46 -0700 Subject: compilers: Split msvc version code into helper ICL needs ot use some of this code, but not from it's own version information. --- mesonbuild/compilers/compilers.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'mesonbuild/compilers/compilers.py') 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 [] -- cgit v1.1