SCons: Make `lto=auto` prefer ThinLTO over full LTO for LLVM targets
@@ -184,8 +184,8 @@ def configure(env: "SConsEnvironment"):
# LTO
- if env["lto"] == "auto": # Full LTO for production.
- env["lto"] = "full"
+ if env["lto"] == "auto": # Enable LTO for production.
+ env["lto"] = "thin" if env["use_llvm"] else "full"
if env["lto"] != "none":
if env["lto"] == "thin":
@@ -117,8 +117,8 @@ def configure(env: "SConsEnvironment"):
+ env["lto"] = "thin"
@@ -762,8 +762,8 @@ def configure_mingw(env: "SConsEnvironment"):
## LTO
- if env["lto"] == "auto": # Full LTO for production with MinGW.
+ if env["lto"] == "auto": # Enable LTO for production with MinGW.