From 35a15e619161798820b2bd6ff46178c5b7ccebcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 13 Sep 2022 17:01:47 +0200 Subject: SCons: Refactor handling of `production` flag and per-platform LTO defaults Fixup to #63288. See #65583 for the bug report. Co-authored-by: Cyberrebell --- platform/ios/detect.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/detect.py b/platform/ios/detect.py index ed7e714c4e..d5e6ee4b46 100644 --- a/platform/ios/detect.py +++ b/platform/ios/detect.py @@ -39,9 +39,6 @@ def get_flags(): ("arch", "arm64"), # Default for convenience. ("tools", False), ("use_volk", False), - # Disable by default even if production is set, as it makes linking in Xcode - # on exports very slow and that's not what most users expect. - ("lto", "none"), ] @@ -73,7 +70,11 @@ def configure(env): env.Append(CCFLAGS=["-gdwarf-2", "-O0"]) env.Append(CPPDEFINES=["_DEBUG", ("DEBUG", 1)]) - # LTO + ## LTO + + if env["lto"] == "auto": # Disable by default as it makes linking in Xcode very slow. + env["lto"] = "none" + if env["lto"] != "none": if env["lto"] == "thin": env.Append(CCFLAGS=["-flto=thin"]) -- cgit v1.2.3