From 488e57332f2264594ec8e05369664c6a7833f692 Mon Sep 17 00:00:00 2001 From: Niklas Claesson Date: Wed, 6 Sep 2017 23:53:49 +0200 Subject: VisualC: Add support for msvc toolset version --- mesonbuild/compilers/c.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'mesonbuild/compilers/c.py') diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 82b1ef0..d4da2da 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -1056,3 +1056,29 @@ class VisualStudioCCompiler(CCompiler): # and the can not be called. return None return vs32_instruction_set_args.get(instruction_set, None) + + def get_toolset_version(self): + # See boost/config/compiler/visualc.cpp for up to date mapping + try: + version = int(''.join(self.version.split('.')[0:2])) + except: + return None + if version < 1310: + return '7.0' + elif version < 1400: + return '7.1' # (Visual Studio 2003) + elif version < 1500: + return '8.0' # (Visual Studio 2005) + elif version < 1600: + return '9.0' # (Visual Studio 2008) + elif version < 1700: + return '10.0' # (Visual Studio 2010) + elif version < 1800: + return '11.0' # (Visual Studio 2012) + elif version < 1900: + return '12.0' # (Visual Studio 2013) + elif version < 1910: + return '14.0' # (Visual Studio 2015) + elif version < 1920: + return '14.1' # (Visual Studio 2017) + return None -- cgit v1.1 From 09ccd0eeaad402f1e7e5b18bd1ad168a9db2998b Mon Sep 17 00:00:00 2001 From: Niklas Claesson Date: Thu, 14 Sep 2017 10:05:37 +0200 Subject: C/C++: Get default include dirs from compilers --- mesonbuild/compilers/c.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mesonbuild/compilers/c.py') diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index d4da2da..3f9ba5c 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -172,6 +172,9 @@ class CCompiler(Compiler): def get_linker_search_args(self, dirname): return ['-L' + dirname] + def get_default_include_dirs(self): + return [] + def gen_import_library_args(self, implibname): """ The name of the outputted import library @@ -1082,3 +1085,8 @@ class VisualStudioCCompiler(CCompiler): elif version < 1920: return '14.1' # (Visual Studio 2017) return None + + def get_default_include_dirs(self): + if 'INCLUDE' not in os.environ: + return [] + return os.environ['INCLUDE'].split(os.pathsep) -- cgit v1.1