aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-09-07 17:21:56 -0400
committerEli Schwartz <eschwartz@archlinux.org>2022-09-07 17:27:55 -0400
commit167356aeabe576b0c777b329748d314d4931a777 (patch)
treed7a86771bd79a352ad47c86ff6a05924f7b96b3b /mesonbuild/compilers
parent7bdfe7ccb224d65b21feea4c6a92ddf57ca0c18c (diff)
downloadmeson-167356aeabe576b0c777b329748d314d4931a777.zip
meson-167356aeabe576b0c777b329748d314d4931a777.tar.gz
meson-167356aeabe576b0c777b329748d314d4931a777.tar.bz2
compilers: correct the MSVC version comparison for turning on __cplusplus
We compared a Visual Studio (the IDE) version, but we wanted a MSVC (the compiler) version. This caused the option to be passed for a few too many versions of MSVC, and emit a "D9002 : ignoring unknown option" on those systems. Compare the correct version using the version mapping from https://walbourn.github.io/vs-2017-15-7-update/ Fixes #10787 Co-authored-by: CorrodedCoder <38778644+CorrodedCoder@users.noreply.github.com>
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/cpp.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
index c8f0df4..2bb1b84 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -740,7 +740,7 @@ class VisualStudioCPPCompiler(CPP11AsCPP14Mixin, VisualStudioLikeCPPCompilerMixi
# By default, MSVC has a broken __cplusplus define that pretends to be c++98:
# https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-160
# Pass the flag to enable a truthful define, if possible.
- if version_compare(self.version, '>= 15.7') and '/Zc:__cplusplus' not in args:
+ if version_compare(self.version, '>= 19.14.26428') and '/Zc:__cplusplus' not in args:
return args + ['/Zc:__cplusplus']
return args