Adding a package to two targets in one projects results in an error

It's incorrect because the package is linked to two separate executables, there's no chance there will be duplicate symbols. This is the project structure, and I do not want to use dynamic libraries.

Target A: A command line program
Target B: A XPC service
Target C: A SwiftUI application using the XPC service

Targets A and B use the same package, a set of "helper" Swift files.

Target A is used by Target B, and Target B is used by Target C. They are all separate processes, all linked independently. There is no reason whatsoever for Xcode to detect these as duplicate linking and fail the build.

3 Likes