6
votes

In my project I have a high number of static libraries. I currently use the -ObjC linker flag which will include all members of static libraries that implement any objective-c class.

I have 1 particularly large static library where I specifically want only classes which are used to be included in the binary (I am aware of the dynamic nature of objective-c and the caveats of doing this). This is what would happen if the -ObjC were not used.

Is it possible to specify to the linker that I want this specific library to not fall under the -ObjC flag?

It would be unfortunate if the only way to accomplish this would be to add the force_load flag for every other library that I somehow figure out contains objc.

1

1 Answers

5
votes

Linker's -ObjC flag doesn't take arguments, and applies to all libraries. Thus your only option is to use -force_load per every other library.

You might be able to automate this with xcodeproj or generated xcconfigs