diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-08-14 13:02:40 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-08-16 10:23:34 +0200 |
commit | 3907e53ff68643785df0066be64fddce9f79919c (patch) | |
tree | aeab699a5c6b3396835f3ba80faa8c682dbbdf2a /platform/ios | |
parent | 90f90cbcb0cf2c44a3114048accfd5b407c4ac98 (diff) | |
download | redot-engine-3907e53ff68643785df0066be64fddce9f79919c.tar.gz |
SCons: Disable C++ exception handling
Upon investigating the extremely slow MSVC build times in #80513, I noticed
that while Godot policy is to never use exceptions, we weren't enforcing it
with compiler flags, and thus still included exception handling code and
stack unwinding.
This is wasteful on multiple aspects:
- Binary size: Around 20% binary size reduction with exceptions disabled
for both MSVC and GCC binaries.
- Compile time:
* More than 50% build time reduction with MSVC.
* 10% to 25% build time reduction with GCC + LTO.
- Performance: Possibly, needs to be benchmarked.
Since users may want to re-enable exceptions in their own thirdparty code
or the libraries they compile with Godot, this behavior can be toggled with
the `disable_exceptions` SCons option, which defaults to true.
Diffstat (limited to 'platform/ios')
-rw-r--r-- | platform/ios/detect.py | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/platform/ios/detect.py b/platform/ios/detect.py index a01f4b55db..e11c0b7d91 100644 --- a/platform/ios/detect.py +++ b/platform/ios/detect.py @@ -30,7 +30,6 @@ def get_opts(): ), ("IOS_SDK_PATH", "Path to the iOS SDK", ""), BoolVariable("ios_simulator", "Build for iOS Simulator", False), - BoolVariable("ios_exceptions", "Enable exceptions", False), ("ios_triple", "Triple for ios toolchain", ""), ] @@ -138,11 +137,6 @@ def configure(env: "Environment"): env.Append(ASFLAGS=["-arch", "arm64"]) env.Append(CPPDEFINES=["NEED_LONG_INT"]) - if env["ios_exceptions"]: - env.Append(CCFLAGS=["-fexceptions"]) - else: - env.Append(CCFLAGS=["-fno-exceptions"]) - # Temp fix for ABS/MAX/MIN macros in iOS SDK blocking compilation env.Append(CCFLAGS=["-Wno-ambiguous-macro"]) |