mirror of
https://github.com/godotengine/godot.git
synced 2025-01-22 10:32:54 -05:00
SCons: Make lto=auto
prefer ThinLTO over full LTO for LLVM targets
This speeds up build time considerably for these platforms compared to using `lto=full`, which is sadly single-threaded with LLVM, unlike GCC. Changes to default behavior of `lto=auto` (i.e. `production=yes`): - Linux: Prefer ThinLTO for LLVM - Web: Prefer ThinLTO - Windows: Prefer ThinLTO for llvm-mingw The following LLVM targets don't use LTO by default currently, which needs to be assessed further (gains from LLVM LTO on performance need to be weighed against the potential size increase from heavy inlining): - Android - iOS - macOS - Windows clang-cl
This commit is contained in:
parent
a52291fcba
commit
26db0bb15f
3 changed files with 6 additions and 6 deletions
|
@ -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"):
|
|||
|
||||
# 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["lto"] != "none":
|
||||
if env["lto"] == "thin":
|
||||
|
|
|
@ -762,8 +762,8 @@ def configure_mingw(env: "SConsEnvironment"):
|
|||
|
||||
## LTO
|
||||
|
||||
if env["lto"] == "auto": # Full LTO for production with MinGW.
|
||||
env["lto"] = "full"
|
||||
if env["lto"] == "auto": # Enable LTO for production with MinGW.
|
||||
env["lto"] = "thin" if env["use_llvm"] else "full"
|
||||
|
||||
if env["lto"] != "none":
|
||||
if env["lto"] == "thin":
|
||||
|
|
Loading…
Reference in a new issue