File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,9 @@ def exists(env):
2828def generate (env ):
2929 # Require C++17
3030 if env .get ("is_msvc" , False ):
31- env .Append (CXXFLAGS = ["/std:c++17" ])
31+ env .Append (CXXFLAGS = ["/std:" + env [ "cpp_standard" ] ])
3232 else :
33- env .Append (CXXFLAGS = ["-std=c++17" ])
33+ env .Append (CXXFLAGS = ["-std=" + env [ "cpp_standard" ] ])
3434
3535 # Disable exception handling. Godot doesn't use exceptions anywhere, and this
3636 # saves around 20% of binary size and very significant build time.
Original file line number Diff line number Diff line change @@ -244,6 +244,12 @@ def options(opts, env):
244244 )
245245 )
246246
247+ opts .Add (
248+ key = "cpp_standard" ,
249+ help = "The C++ standard to use. Minimum required: 'c++17'." ,
250+ default = env .get ("cpp_standard" , "c++17" ),
251+ )
252+
247253 opts .Add (
248254 EnumVariable (
249255 "optimize" ,
You can’t perform that action at this time.
0 commit comments