Multiple Xcode Targets with same SPM dependency

I have a library added to my project added as a SPM dependeny. My project has multiple targets that the main app is dependent on. However, a target won’t compile without linking to the static library. But if mulitple targets need to reference it, it is included in each target giving runtime warnings that it doesn’t know which version to use.


Is there a way for multiple targets included in a master target to reference a static package generated by SPM?


The only I can think of is to create a framework target that includes the static package, and then link to that from all the modules. But that defeates the whole idea of SPM generating static libraries.

Powered by WPeMatico

You may also like...

Comments are closed.