diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-09 00:17:16 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-09 00:21:29 +0200 |
commit | 8897c77d50e3de84fbcd33c762d89bc4e94861e1 (patch) | |
tree | b98a7cab89864fc23b5303a05392bdeec1065c25 /SConstruct | |
parent | b0467d07bfd84c82de5f5dff9d21dc3a8cacd527 (diff) | |
download | redot-engine-8897c77d50e3de84fbcd33c762d89bc4e94861e1.tar.gz |
SCons: Default `optimize` to `auto`, fixing `target`/`dev_build` inference for Web
Fixes #94087.
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/SConstruct b/SConstruct index 3fabc4706f..8e9a536bdc 100644 --- a/SConstruct +++ b/SConstruct @@ -200,7 +200,10 @@ opts.Add(EnumVariable("arch", "CPU architecture", "auto", ["auto"] + architectur opts.Add(BoolVariable("dev_build", "Developer build with dev-only debugging code (DEV_ENABLED)", False)) opts.Add( EnumVariable( - "optimize", "Optimization level", "speed_trace", ("none", "custom", "debug", "speed", "speed_trace", "size") + "optimize", + "Optimization level (by default inferred from 'target' and 'dev_build')", + "auto", + ("auto", "none", "custom", "debug", "speed", "speed_trace", "size"), ) ) opts.Add(BoolVariable("debug_symbols", "Build with debugging symbols", False)) @@ -466,14 +469,15 @@ env.editor_build = env["target"] == "editor" env.dev_build = env["dev_build"] env.debug_features = env["target"] in ["editor", "template_debug"] -if env.dev_build: - opt_level = "none" -elif env.debug_features: - opt_level = "speed_trace" -else: # Release - opt_level = "speed" +if env["optimize"] == "auto": + if env.dev_build: + opt_level = "none" + elif env.debug_features: + opt_level = "speed_trace" + else: # Release + opt_level = "speed" + env["optimize"] = ARGUMENTS.get("optimize", opt_level) -env["optimize"] = ARGUMENTS.get("optimize", opt_level) env["debug_symbols"] = methods.get_cmdline_bool("debug_symbols", env.dev_build) if env.editor_build: |