Skip to content

Commit

Permalink
Turn off exceptions to reduce binary size (-600KB for arm64) (#1033)
Browse files Browse the repository at this point in the history
* Turn off exceptions to reduce binary size

* Changelog
  • Loading branch information
Adlai-Holler authored Jul 16, 2018
1 parent f2912ec commit 6ed5ba2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
18 changes: 15 additions & 3 deletions AsyncDisplayKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2738,7 +2738,11 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MODULEMAP_FILE = Source/AsyncDisplayKit.modulemap;
MTL_ENABLE_DEBUG_INFO = YES;
OTHER_CFLAGS = "-Wundef";
OTHER_CFLAGS = (
"-Wundef",
"-fno-exceptions",
"-fno-objc-arc-exceptions",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = AsyncDisplayKit;
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -2767,7 +2771,11 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MODULEMAP_FILE = Source/AsyncDisplayKit.modulemap;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = "-Wundef";
OTHER_CFLAGS = (
"-Wundef",
"-fno-exceptions",
"-fno-objc-arc-exceptions",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = AsyncDisplayKit;
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -2881,7 +2889,11 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MODULEMAP_FILE = Source/AsyncDisplayKit.modulemap;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = "-Wundef";
OTHER_CFLAGS = (
"-Wundef",
"-fno-exceptions",
"-fno-objc-arc-exceptions",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = AsyncDisplayKit;
SKIP_INSTALL = YES;
Expand Down
2 changes: 2 additions & 0 deletions BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
COMMON_PREPROCESSOR_FLAGS = [
'-fobjc-arc',
'-DDEBUG=1',
'-fno-exceptions',
'-fno-objc-arc-exceptions'
]

COMMON_LANG_PREPROCESSOR_FLAGS = {
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- Enable locking assertions (and add some more) to improve and enforce locking safety within the framework [Huy Nguyen](https://github.com/nguyenhuy) [#1024](https://github.com/TextureGroup/Texture/pull/1024)
- Split MapKit, Photos, and AssetsLibrary dependent code into separate subspecs to improve binary size and start time when they're not needed. The default subspec includes all three for backwards compatibility, but this **will change in 3.0**. When using non-Cocoapods build environments, define `AS_USE_PHOTOS, AS_USE_MAPKIT, AS_USE_ASSETS_LIBRARY` to 1 respectively to signal their use. [Adlai Holler](https://github.com/Adlai-Holler)
- Optimization: Removed an NSMutableArray in flattened layouts. [Adlai Holler](https://github.com/Adlai-Holler)
- Reduced binary size by disabling exception support (which we don't use.) [Adlai Holler](https://github.com/Adlai-Holler)

## 2.7
- Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877)
Expand Down
2 changes: 1 addition & 1 deletion Source/ASDisplayNodeExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define ASSetDebugName(node, format, ...) node.debugName = [NSString stringWithFormat:format, __VA_ARGS__]
#define ASSetDebugNames(...) _ASSetDebugNames(self.class, @"" # __VA_ARGS__, __VA_ARGS__, nil)
#else
#define ASSetDebugName(node, name)
#define ASSetDebugName(node, format, ...)
#define ASSetDebugNames(...)
#endif

Expand Down
1 change: 1 addition & 0 deletions Texture.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Pod::Spec.new do |spec|

# Subspecs
spec.subspec 'Core' do |core|
core.compiler_flags = '-fno-exceptions -fno-objc-arc-exceptions'
core.public_header_files = [
'Source/*.h',
'Source/Details/**/*.h',
Expand Down

0 comments on commit 6ed5ba2

Please sign in to comment.