diff --git a/SConstruct b/SConstruct index c5907c1ec..eddc0e489 100644 --- a/SConstruct +++ b/SConstruct @@ -477,6 +477,10 @@ if selected_platform in platform_list: env.Prepend(CXXFLAGS=["/EHs-"]) env.Prepend(CXXFLAGS=["/EHc-"]) env.Prepend(CXXFLAGS=["/EHr-"]) + else: + if env.msvc: + env_base.Prepend(CXXFLAGS=["/EHsc"]) + env.Prepend(CXXFLAGS=["/EHsc"]) # Handle renamed options. if "use_lto" in ARGUMENTS or "use_thinlto" in ARGUMENTS: diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 0c853baa7..97980c65a 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -192,7 +192,7 @@ def configure_msvc(env, manual_msvc_config): env.Append(LINKFLAGS=["/OPT:REF"]) elif env["target"] == "debug": - env.AppendUnique(CCFLAGS=["/Zi", "/FS", "/Od", "/EHsc"]) + env.AppendUnique(CCFLAGS=["/Zi", "/FS", "/Od"]) # Allow big objects. Only needed for debug, see MinGW branch for rationale. env.Append(LINKFLAGS=["/DEBUG"]) @@ -215,7 +215,7 @@ def configure_msvc(env, manual_msvc_config): else: env.AppendUnique(CCFLAGS=["/MD"]) - env.AppendUnique(CCFLAGS=["/Gd", "/GR", "/nologo"]) + env.AppendUnique(CCFLAGS=["/Gd", "/nologo"]) env.AppendUnique(CCFLAGS=["/utf-8"]) # Force to use Unicode encoding. env.AppendUnique(CXXFLAGS=["/TP"]) # assume all sources are C++ # Once it was thought that only debug builds would be too large,