Dynamic Linking within a Single Package

Is there a way to make a package target depend on a dynamic library product in the same package?

It doesn’t seem to be able to find the products in the same package, even when declared explicitly: .productItem(name: "LibraryProduct", package: "ThisPackage").

Depending on the corresponding targets instead compiles fine, but then nothing is linked dynamically.

What I want to do is have two executables share code in a library, and have all three in one package, thereby reducing the binary size of the two executables. Right now though, adding the library product just causes its content to duplicated an additional time, bringing it to three copies of the same binary content.

Did you find out any way to do this?

No. It is still not possible.

1 Like
Terms of Service

Privacy Policy

Cookie Policy