Hi!
I have a bigger Xcode project that has multiple targets:
- the main app (
MainApp) - helper command line tool (
HelperTool)
The project also lists multiple package dependencies via SwiftPM and these dependencies have dependencies between themselves.
One of such packages produces a dynamic library MyFramework which is a dependency for both the main app and the HelperTool which has it listed under Build Phases > Dependencies as well as under Link with Frameworks.
This builds just fine, but the issue somes when I want to add another target called AdditionalHelperTool which it has pretty much the same dependencies as HelperTool.
When I add this second target, I start running into issues like the following:
Multiple commands produce '[...]/Build/Products/Debug/Frameworks/MyFramework.framework/Versions/A'
Target 'HelperTool' (project 'MyApp') has copy command from '[...]/Build/Products/Debug/PackageFrameworks/MyFramework.framework' to '[...]/Build/Products/Debug/Frameworks/MyFramework.framework'
Target 'AdditionalHelperTool' (project 'MyApp') has copy command from '[...]/Build/Products/Debug/PackageFrameworks/MyFramework.framework' to '[...]/Build/Products/Debug/Frameworks/MyFramework.framework'`
It seems that Xcode runs the build of both targets separately and it sees a conflict given that both targets have same dependencies that it's trying to built separately.
Has anyone encountered something similar? Can anyone suggest a solution for this?