summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2018-12-06 15:13:24 -0500
committerHenrik Edin <henrik.edin@mongodb.com>2018-12-06 16:29:34 -0500
commitb004f4a0202057d514096cd849329cdbca048a5e (patch)
treec07ae88e5c24e72caf397779cc6948298403cabe /SConstruct
parent7cc3c41cf8060966545c844e4d83c7d0ff3994e8 (diff)
downloadmongo-b004f4a0202057d514096cd849329cdbca048a5e.tar.gz
SERVER-37609 Visual Studio 2017 15.9 or later is required to compile on Windows
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct15
1 files changed, 4 insertions, 11 deletions
diff --git a/SConstruct b/SConstruct
index ee3335291b4..33bfbcd0131 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1935,14 +1935,14 @@ def doConfigure(myenv):
# bare compilers, and we should re-check at the very end that TryCompile and TryLink still
# work with the flags we have selected.
if myenv.ToolchainIs('msvc'):
- compiler_minimum_string = "Microsoft Visual Studio 2015 Update 3"
+ compiler_minimum_string = "Microsoft Visual Studio 2017 15.9"
compiler_test_body = textwrap.dedent(
"""
#if !defined(_MSC_VER)
#error
#endif
- #if _MSC_VER < 1900 || (_MSC_VER == 1900 && _MSC_FULL_VER < 190024218)
+ #if _MSC_VER < 1916
#error %s or newer is required to build MongoDB
#endif
@@ -2360,10 +2360,11 @@ def doConfigure(myenv):
conf.Finish()
if myenv.ToolchainIs('msvc'):
+ myenv.AppendUnique(CXXFLAGS=['/Zc:__cplusplus'])
if get_option('cxx-std') == "14":
myenv.AppendUnique(CCFLAGS=['/std:c++14'])
elif get_option('cxx-std') == "17":
- myenv.AppendUnique(CCFLAGS=['/std:c++17', '/Zc:__cplusplus'])
+ myenv.AppendUnique(CCFLAGS=['/std:c++17'])
else:
if get_option('cxx-std') == "14":
if not AddToCXXFLAGSIfSupported(myenv, '-std=c++14'):
@@ -2378,19 +2379,11 @@ def doConfigure(myenv):
if using_system_version_of_cxx_libraries():
print( 'WARNING: System versions of C++ libraries must be compiled with C++14/17 support' )
- # We appear to have C++14, or at least a flag to enable it. Check that the declared C++
- # language level is not less than C++14, and that we can at least compile an 'auto'
- # expression. We don't check the __cplusplus macro when using MSVC because as of our
- # current required MS compiler version (MSVS 2015 Update 2), they don't set it. If
- # MSFT ever decides (in MSVS 2017?) to define __cplusplus >= 201402L, remove the exception
- # here for _MSC_VER
def CheckCxx14(context):
test_body = """
- #ifndef _MSC_VER
#if __cplusplus < 201402L
#error
#endif
- #endif
auto DeducedReturnTypesAreACXX14Feature() {
return 0;
}