Skip to content

Commit a5973ec

Browse files
authored
Explicit target dependency check needs to take into account conditionals (#5786)
This ensures we're erroring when there's an import of a module that is excluded via a target conditional in the package manifest. rdar://81587673
1 parent d35579a commit a5973ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Build/BuildOperationBuildSystemDelegateHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ public struct BuildDescription: Codable {
336336
self.copyCommands = copyCommands
337337
self.explicitTargetDependencyImportCheckingMode = plan.buildParameters.explicitTargetDependencyImportCheckingMode
338338
self.targetDependencyMap = try plan.targets.reduce(into: [TargetName: [TargetName]]()) {
339-
let deps = try $1.target.recursiveTargetDependencies().map { $0.c99name }
339+
let deps = try $1.target.recursiveDependencies(satisfying: plan.buildParameters.buildEnvironment).compactMap { $0.target }.map { $0.c99name }
340340
$0[$1.target.c99name] = deps
341341
}
342342
var targetCommandLines: [TargetName: [CommandLineFlag]] = [:]

0 commit comments

Comments
 (0)