1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

SCons: Refactor handling of production flag and per-platform LTO defaults

Fixup to #63288.
See #65583 for the bug report.

Co-authored-by: Cyberrebell <chainsaw75@web.de>
This commit is contained in:
Rémi Verschelde
2022-09-13 17:01:47 +02:00
parent 6f5704d86f
commit 35a15e6191
7 changed files with 65 additions and 47 deletions

View File

@@ -47,9 +47,6 @@ def get_flags():
return [
("arch", "arm64"), # Default for convenience.
("tools", False),
# Benefits of LTO for Android (size, performance) haven't been clearly established yet.
# So for now we override the default value which may be set when using `production=yes`.
("lto", "none"),
]
@@ -136,6 +133,10 @@ def configure(env):
env.Append(CPPFLAGS=["-UNDEBUG"])
# LTO
if env["lto"] == "auto": # LTO benefits for Android (size, performance) haven't been clearly established yet.
env["lto"] = "none"
if env["lto"] != "none":
if env["lto"] == "thin":
env.Append(CCFLAGS=["-flto=thin"])