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):
28
28
def generate (env ):
29
29
# Require C++17
30
30
if env .get ("is_msvc" , False ):
31
- env .Append (CXXFLAGS = ["/std:c++17" ])
31
+ env .Append (CXXFLAGS = ["/std:" + env [ "cpp_standard" ] ])
32
32
else :
33
- env .Append (CXXFLAGS = ["-std=c++17" ])
33
+ env .Append (CXXFLAGS = ["-std=" + env [ "cpp_standard" ] ])
34
34
35
35
# Disable exception handling. Godot doesn't use exceptions anywhere, and this
36
36
# 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):
244
244
)
245
245
)
246
246
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
+
247
253
opts .Add (
248
254
EnumVariable (
249
255
"optimize" ,
You can’t perform that action at this time.
0 commit comments