diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2022-04-18 21:04:24 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2022-05-13 01:12:20 +0200 |
commit | 78b4ec2d4d0d6233ca0f4d8cfeb74640063e970f (patch) | |
tree | 007e55d8014441ff904c465488cf60965b3f7485 /platform/iphone | |
parent | 2f47a0747cd0ab0c823dee831167d168ec844f11 (diff) |
Increase compiler optimization when using `target=release` on iOS/Android
Diffstat (limited to 'platform/iphone')
-rw-r--r-- | platform/iphone/detect.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index f442235e7c..392a0151be 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -47,8 +47,11 @@ def configure(env): if env["target"].startswith("release"): env.Append(CPPDEFINES=["NDEBUG", ("NS_BLOCK_ASSERTIONS", 1)]) if env["optimize"] == "speed": # optimize for speed (default) - env.Append(CCFLAGS=["-O2", "-ftree-vectorize", "-fomit-frame-pointer"]) - env.Append(LINKFLAGS=["-O2"]) + # `-O2` is more friendly to debuggers than `-O3`, leading to better crash backtraces + # when using `target=release_debug`. + opt = "-O3" if env["target"] == "release" else "-O2" + env.Append(CCFLAGS=[opt, "-ftree-vectorize", "-fomit-frame-pointer"]) + env.Append(LINKFLAGS=[opt]) elif env["optimize"] == "size": # optimize for size env.Append(CCFLAGS=["-Os", "-ftree-vectorize"]) env.Append(LINKFLAGS=["-Os"]) |