Skip to content

Commit 9c6d2e9

Browse files
committed
[xcodegen] Remove duplicate file check from tryAddTarget
I don't recall why I added this, a file can be in multiple targets and xcodegen handles that case just fine.
1 parent c380c41 commit 9c6d2e9

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

utils/swift-xcodegen/Sources/SwiftXcodeGen/BuildArgs/SwiftTargets.swift

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ struct SwiftTargets {
1717
private var dependenciesByTargetName: [String: Set<String>] = [:]
1818
private var targetsByName: [String: SwiftTarget] = [:]
1919
private var targetsByOutput: [String: SwiftTarget] = [:]
20-
private var addedFiles: Set<RelativePath> = []
2120

2221
// Track some state for debugging
2322
private var debugLogUnknownFlags: Set<String> = []
@@ -204,22 +203,10 @@ struct SwiftTargets {
204203
var buildRule: SwiftTarget.BuildRule?
205204
var emitModuleRule: SwiftTarget.EmitModuleRule?
206205
if forBuild && !repoSources.isEmpty {
207-
// Bail if we've already recorded a target with one of these inputs.
208-
// TODO: Attempt to merge?
209-
// TODO: Should we be doing this later?
210-
for input in repoSources {
211-
guard addedFiles.insert(input).inserted else {
212-
log.debug("""
213-
! Skipping '\(name)' with output '\(primaryOutput)'; \
214-
contains input '\(input)' already added
215-
""")
216-
return
217-
}
218-
}
219206
// We've already ensured that `repoSources` is non-empty.
220-
let parent = repoSources.commonAncestor!
221207
buildRule = .init(
222-
parentPath: parent, sources: sources, buildArgs: buildArgs
208+
parentPath: repoSources.commonAncestor!, sources: sources,
209+
buildArgs: buildArgs
223210
)
224211
}
225212
if forModule {

0 commit comments

Comments
 (0)