How to ignore -Objc flag for specific library
Asked Answered
R

1

6

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.

Radiocommunication answered 22/1, 2017 at 6:51 Comment(0)
S
5

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

Sestertium answered 30/1, 2017 at 21:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.