Prevent static library dependency from being linked into final framework

We are building a framework A that has a dependency on a third party binary static library B. Because the B is statically linked, it is present in the final framework. That means that any integrating apps that use the B as well will get duplicate symbol warnings. One way to fix it is to use @_implementationOnly imports inside A, which will hide the symbols, but we are conforming one of the public classes in A to a public entity in B so that doesn't work. Plus the binary size is bigger because it includes B as well.

Is there a way to build framework A so that B is not included at all? We are using SPM, there we specify B as a dependency. So can the final app do the resolution of B's version and do the final linking?

1 Like