1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +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>
(cherry picked from commit 35a15e6191)
This commit is contained in:
Rémi Verschelde
2022-09-13 17:01:47 +02:00
parent 713e83ecd7
commit d5c1baa288
7 changed files with 61 additions and 44 deletions

View File

@@ -48,9 +48,6 @@ def get_ndk_version():
def get_flags():
return [
("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"),
]
@@ -141,6 +138,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"])