summaryrefslogtreecommitdiff
path: root/platform/android/detect.py
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-05-13 10:23:26 +0200
committerGitHub <noreply@github.com>2022-05-13 10:23:26 +0200
commit6a9a76d00851edcfc9b9f7afc0762b810f84dc21 (patch)
treef4320ec262fd07511a9fee402560933dc0b2b9e6 /platform/android/detect.py
parent9a368e9d4bf4f5698ac566d76c833645587de5d4 (diff)
parent78b4ec2d4d0d6233ca0f4d8cfeb74640063e970f (diff)
Merge pull request #60358 from Calinou/scons-android-ios-tweak-optimization
Diffstat (limited to 'platform/android/detect.py')
-rw-r--r--platform/android/detect.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/platform/android/detect.py b/platform/android/detect.py
index 3319d5890c..0099ac7e0d 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -188,8 +188,11 @@ def configure(env):
if env["target"].startswith("release"):
if env["optimize"] == "speed": # optimize for speed (default)
- env.Append(LINKFLAGS=["-O2"])
- env.Append(CCFLAGS=["-O2", "-fomit-frame-pointer"])
+ # `-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(LINKFLAGS=[opt])
+ env.Append(CCFLAGS=[opt, "-fomit-frame-pointer"])
elif env["optimize"] == "size": # optimize for size
env.Append(CCFLAGS=["-Os"])
env.Append(LINKFLAGS=["-Os"])