How to ignore Objc flag for a specific library

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

I have 1 especially large static library where I specifically want only the classes that are used to be included in the binary (I know about the dynamic nature of objective-c and the caveats about this). This is what happens if -ObjC were not used.

Can I tell the linker that I want this particular library not to fall under the -ObjC flag?

It would be unfortunate if the only way to achieve this is to add the force_load flag for every other library that I somehow discovered that contains objc.

+6
source share
1 answer

The Linker flag takes -ObjCno arguments and applies to all libraries. So your only option is to use -force_loadfor every other library.

You might be able to automate this with xcodeproj or generatedxcconfigs

+5
source

Source: https://habr.com/ru/post/1014297/


All Articles