TL DR
How can I set the -ObjC linker flag for a specific static library, and not for all the static libraries that I link with to avoid using unused object files in my application?
Too long; Read
So, you are developing a new application for iOS and adding to your old home library “objcutil”, which contains many useful Objective-C classes (not implemented as categories) to do various things that were useful in the past. So far, so good, and only those object files that are referenced in the utility library are associated with the application.
Then you decide to integrate the Google Maps SDK in which you want to use the -ObjC Other Linker Flags and all unexpected dependencies in the utility library cannot be resolved since you did not configure Xcode to communicate with these libraries.
OK. I can easily resolve missing dependencies, but now you have unused library object and library files that you don’t need, and you would like to be a little more neat.
So how do you avoid OCD overload?
Some links from
ld manpage:
-ObjC Loads all members of static archive libraries that define an Objective-C class or category. This option does not apply to dynamic shared libraries.
- Xcode Version: 5.1.1
- OS Version: 10.9.4
source share