mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Add option for not linking dependencies
This adds a new attribute to Dependency that allows consumers to choose to not link a dependency. This is useful for if you have this dependency tree with static libraries: App -> A -> Shared App -> B -> Shared Where A and B both share a static library dependency, that is finally linked into App. If Shared is added to the link phase of A and B, you end up with duplicate symbols during the link phase. With this change consumers could set link: False on A and B's dependency on Shared, this way Shared will get build before A and B, but not linked.
This commit is contained in:
@@ -248,7 +248,7 @@ public class PBXProjGenerator {
|
||||
addObject(targetDependency)
|
||||
dependencies.append(targetDependency.reference)
|
||||
|
||||
if dependencyTarget.type.isLibrary || dependencyTarget.type.isFramework {
|
||||
if (dependencyTarget.type.isLibrary || dependencyTarget.type.isFramework) && dependency.link {
|
||||
let dependencyBuildFile = targetBuildFiles[dependencyTargetName]!
|
||||
let buildFile = PBXBuildFile(reference: generateUUID(PBXBuildFile.self, dependencyBuildFile.reference + target.name), fileRef: dependencyBuildFile.fileRef)
|
||||
addObject(buildFile)
|
||||
|
||||
Reference in New Issue
Block a user