Hi,
I am a framework developer and want to use a Swift package as a dependency in my framework. When adding a Swift package to a project, choosing package product "Foo" of kind "Dynamic Library" then it is added to the desired target. The dynamic library appears in Target as following:
General -> Framework and Libraries
Name: Foo
Embed: Embed + Sign
Build Phases -> Link Binary with Libraries
Name: Foo
Status: Required
Build Phases -> Embed Frameworks
Name: Foo
Code Sign on Copy: ✓
Issue: When I attempt to switch embed status to
Do not Emb
, Xcode again will simply delete the dependency.Observed in Xcode versions: 11.3.1 and higher
Expected behavior: Xcode shall allow to use
Do not Embed
in my framework's project file and let the main project embed the libraryWorkaround: Modify the xcodeproj file manually with a text editor and remove the embed phase. This was proposed in https://forums.swift.org/t/is-this-an-xcode-bug-or-somehow-related-to-spm/33987/2
I'd like to know if Xcode behavior is a bug. If it is not a bug then it would be great to explain the rationale behind it. Is it that in theory, the main project could embed one version of the library binary while the framework is linked against another resulting in unexpected behavior.
Thanks,
Marco