aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/cpp.py
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-10-24 14:47:02 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2018-11-04 15:42:06 +0000
commita025c98d3082806321f53c4dfae9c738d1dc1584 (patch)
tree612004e694d1d22d34b7de549a4793ef4448d759 /mesonbuild/compilers/cpp.py
parent48351e70cd4732b913c49f6fd42621ff8b6d87f4 (diff)
downloadmeson-a025c98d3082806321f53c4dfae9c738d1dc1584.zip
meson-a025c98d3082806321f53c4dfae9c738d1dc1584.tar.gz
meson-a025c98d3082806321f53c4dfae9c738d1dc1584.tar.bz2
Qualify checks of self.version by self.id in VisualStudioC/CPPCompiler
Diffstat (limited to 'mesonbuild/compilers/cpp.py')
-rw-r--r--mesonbuild/compilers/cpp.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
index 1045c7d..65a1033 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -310,12 +310,15 @@ class VisualStudioCPPCompiler(VisualStudioCCompiler, CPPCompiler):
def get_options(self):
cpp_stds = ['none', 'c++11', 'vc++11']
- # Visual Studio 2015 and later
- if version_compare(self.version, '>=19'):
- cpp_stds.extend(['c++14', 'vc++14', 'c++latest', 'vc++latest'])
- # Visual Studio 2017 and later
- if version_compare(self.version, '>=19.11'):
- cpp_stds.extend(['c++17', 'vc++17'])
+ if self.id == 'clang-cl':
+ cpp_stds.extend(['c++14', 'vc++14', 'c++17', 'vc++17', 'c++latest'])
+ else:
+ # Visual Studio 2015 and later
+ if version_compare(self.version, '>=19'):
+ cpp_stds.extend(['c++14', 'vc++14', 'c++latest', 'vc++latest'])
+ # Visual Studio 2017 and later
+ if version_compare(self.version, '>=19.11'):
+ cpp_stds.extend(['c++17', 'vc++17'])
opts = CPPCompiler.get_options(self)
opts.update({'cpp_eh': coredata.UserComboOption('cpp_eh',
@@ -356,7 +359,7 @@ class VisualStudioCPPCompiler(VisualStudioCCompiler, CPPCompiler):
# which means setting the C++ standard version to C++14, in compilers that support it
# (i.e., after VS2015U3)
# if one is using anything before that point, one cannot set the standard.
- if version_compare(self.version, '>=19.00.24210'):
+ if self.id == 'clang-cl' or version_compare(self.version, '>=19.00.24210'):
mlog.warning('MSVC does not support C++11; '
'attempting best effort; setting the standard to C++14')
args.append('/std:c++14')