Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

get rid of -ObjC linker flag #2966

Closed
incanus opened this issue Nov 6, 2015 · 3 comments
Closed

get rid of -ObjC linker flag #2966

incanus opened this issue Nov 6, 2015 · 3 comments
Assignees
Labels
build iOS Mapbox Maps SDK for iOS

Comments

@incanus
Copy link
Contributor

incanus commented Nov 6, 2015

This flag is used in order to ensure that categories are properly linked into the final product. Another approach here would be add class methods to each category, then call them each from a non-category to ensure they get pulled in as linked dependencies.

https://developer.apple.com/library/mac/qa/qa1490/_index.html

Passing the -ObjC option to the linker causes it to load all members of static libraries that implement any Objective-C class or category. This will pickup any category method implementations. But it can make the resulting executable larger, and may pickup unnecessary objects. For this reason it is not on by default.

This will decrease our binary size.

@incanus incanus added iOS Mapbox Maps SDK for iOS build labels Nov 6, 2015
@incanus incanus self-assigned this Nov 6, 2015
@incanus
Copy link
Contributor Author

incanus commented Nov 6, 2015

Would love your 👀 here @1ec5, but I think this should just work.

@incanus
Copy link
Contributor Author

incanus commented Nov 6, 2015

👉 #2967

@incanus
Copy link
Contributor Author

incanus commented Nov 7, 2015

Implemented in 423cfc1.

@incanus incanus closed this as completed Nov 7, 2015
friedbunny added a commit that referenced this issue Nov 17, 2015
- Remove MGLDummy.h (#1426)
- Remove `-ObjC` linker flag (#2966)
1ec5 added a commit that referenced this issue Apr 17, 2016
Xcode’s static library template comes with the -ObjC linker flag by default. Instead of removing that flag, this change removes the various imperfect workarounds we’ve been using to ensure that private SDK categories link. Given the size decrease in this static library since #2966 was fixed, we should have room to spare for the more straightforward approach. Moreover, an application that uses MGLMapView in a storyboard no longer needs to add -ObjC to the application target, which bloated the entire application, including other frameworks that had no need for -ObjC.

-ObjC isn’t even needed for dynamic frameworks, and the OS X SDK is only built as a dynamic framework.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

1 participant