Browse Source

Merge pull request #95800 from mihe/msvc-standards-conformance

Enable more standards conformance for MSVC
Rémi Verschelde 1 year ago
parent
commit
5e400c7bd9
1 changed files with 4 additions and 0 deletions
  1. 4 0
      SConstruct

+ 4 - 0
SConstruct

@@ -773,6 +773,10 @@ else:
     # MSVC doesn't have clear C standard support, /std only covers C++.
     # MSVC doesn't have clear C standard support, /std only covers C++.
     # We apply it to CCFLAGS (both C and C++ code) in case it impacts C features.
     # We apply it to CCFLAGS (both C and C++ code) in case it impacts C features.
     env.Prepend(CCFLAGS=["/std:c++17"])
     env.Prepend(CCFLAGS=["/std:c++17"])
+    # MSVC is non-conforming with the C++ standard by default, so we enable more conformance.
+    # Note that this is still not complete conformance, as certain Windows-related headers
+    # don't compile under complete conformance.
+    env.Prepend(CCFLAGS=["/permissive-"])
 
 
 # Disable exception handling. Godot doesn't use exceptions anywhere, and this
 # Disable exception handling. Godot doesn't use exceptions anywhere, and this
 # saves around 20% of binary size and very significant build time (GH-80513).
 # saves around 20% of binary size and very significant build time (GH-80513).