Fix issue that caused static framework target dependencies from having their default link value inferred as true#1110
Conversation
…ies to dynamic framework targets to reproduce bug
…et dependencies where the dependency is a static framework (not library)
|
Before I mark this as ready for review, there are a couple of other places in Requires ObjC LinkingXcodeGen/Sources/XcodeGenKit/PBXProjGenerator.swift Lines 720 to 723 in a4d7a61 I'm not completely sure if "ObjC linking" is the same and if it applies to static frameworks or not? Other Dependency Types
|
|
Hi @liamnichols. Thanks for this, your change makes sense. As for the other places, I'm honestly not sure. Maybe just go with your change, and someone else might bring up if something else is not working. For this could you add a changelog entry, might need to rebase off master to get the latest changelog. |
I'm updating our project to statically link some framework targets instead of using dynamic linking for everything and I spotted some warnings appearing in CI when doing do:
It appears that this happens when I have three targets:
MyFramework1- Dynamic Framework (framework)MyFramework2- Static Framework (framework.static) with dependency onMyFramework1MyApp- iOS app target with dependency onMyFramework2(and a transitive dependency onMyFramework1)In this setup, the
MyFramework2target should not have a "Link Binary With Libraries" build phase because the libraries should be linked into the executable targetMyAppinstead. After looking at the docs, and digging into the current fixtures, it appeared that this was defaulting thelinkproperty to the correct value ifMyFramework2was a static library (library.static) but not forframework.staticorframeworkwith theMACH_O_TYPEbuild setting set tostaticlib.After setting up some extra targets in the fixtures to reproduce the setup (1f391f1), i tracked the issue down to
PBXProjectGeneratorand updated it to use thedefaultLinkageproperty that is also used for figuring out if the dependency should be embedded or not (159f719). You can find the fixtures regenerated after making the changes in8e19482.