summaryrefslogtreecommitdiffstats
path: root/platform/macos/detect.py
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-09-20 09:45:33 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-09-20 09:45:33 +0200
commitaa553f403099a31520ab0c75a43f352642170d5f (patch)
treebdc0939e0877c56efa73473e43d262ed96e6cea9 /platform/macos/detect.py
parent7da532275bdddce4bfcb871bd6ded8fe2163b341 (diff)
parent35a15e619161798820b2bd6ff46178c5b7ccebcf (diff)
downloadredot-engine-aa553f403099a31520ab0c75a43f352642170d5f.tar.gz
Merge pull request #65745 from akien-mga/scons-production-lto-earlier
Refactor handling of `production` flag and per-platform LTO defaults
Diffstat (limited to 'platform/macos/detect.py')
-rw-r--r--platform/macos/detect.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/platform/macos/detect.py b/platform/macos/detect.py
index bcf4776609..834ac935d8 100644
--- a/platform/macos/detect.py
+++ b/platform/macos/detect.py
@@ -40,9 +40,6 @@ def get_flags():
return [
("arch", detect_arch()),
("use_volk", False),
- # Benefits of LTO for macOS (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"),
]
@@ -170,6 +167,10 @@ def configure(env):
env["AS"] = basecmd + "as"
# LTO
+
+ if env["lto"] == "auto": # LTO benefits for macOS (size, performance) haven't been clearly established yet.
+ env["lto"] = "none"
+
if env["lto"] != "none":
if env["lto"] == "thin":
env.Append(CCFLAGS=["-flto=thin"])
@@ -178,6 +179,8 @@ def configure(env):
env.Append(CCFLAGS=["-flto"])
env.Append(LINKFLAGS=["-flto"])
+ # Sanitizers
+
if env["use_ubsan"] or env["use_asan"] or env["use_tsan"]:
env.extra_suffix += ".san"
env.Append(CCFLAGS=["-DSANITIZERS_ENABLED"])