From 796b38c73b87bfdf120e5fddcb77081dcd12b57a Mon Sep 17 00:00:00 2001 From: David Snopek Date: Thu, 8 Oct 2026 10:33:49 -0500 Subject: [PATCH] SCons: Add `production=yes` option to use recommended production settings --- tools/godotcpp.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/godotcpp.py b/tools/godotcpp.py index bd01fbe0d..080678e99 100644 --- a/tools/godotcpp.py +++ b/tools/godotcpp.py @@ -393,6 +393,7 @@ def options(opts, env): ) ) opts.Add(BoolVariable("debug_symbols", "Build with debugging symbols", True)) + opts.Add(BoolVariable("production", "Set defaults to build godot-cpp for use in production", False)) opts.Add(BoolVariable("deprecated", "Enable compatibility code for deprecated and removed features", True)) opts.Add(BoolVariable("dev_build", "Developer build with dev-only debugging code (DEV_ENABLED)", False)) opts.Add(BoolVariable("verbose", "Enable verbose output for the compilation", False)) @@ -467,6 +468,13 @@ def generate(env): env["optimize"] = ARGUMENTS.get("optimize", opt_level) env["debug_symbols"] = get_cmdline_bool("debug_symbols", env.dev_build) + if env["production"]: + if "use_static_cpp" in env: + env["use_static_cpp"] = get_cmdline_bool("use_static_cpp", True) + env["debug_symbols"] = get_cmdline_bool("debug_symbols", False) + # LTO "auto" means we handle the preferred option in each platform tool. + env["lto"] = ARGUMENTS.get("lto", "auto") + tool = Tool(env["platform"], toolpath=get_platform_tools_paths(env)) if tool is None or not tool.exists(env):