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

@@ -100,6 +100,10 @@ def configure(env):
env["ENV"] = os.environ
# LTO
if env["lto"] == "auto": # Full LTO for production.
env["lto"] = "full"
if env["lto"] != "none":
if env["lto"] == "thin":
env.Append(CCFLAGS=["-flto=thin"])