Skip to content

Commit 7ab728d

Browse files
committed
[Integrated Swift driver] Handle derived source files in the integrated driver.
- When computing command line arguments for the integrated driver invocation, append all source files, both user-written and derived. - When writing out an output file map, add derived source files and their build artifacts to it as well.
1 parent b53aead commit 7ab728d

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

Sources/Build/BuildPlan.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ public final class SwiftTargetBuildDescription {
702702
}
703703

704704
result.append("-c")
705-
result.append(contentsOf: target.sources.paths.map { $0.pathString })
705+
result.append(contentsOf: sources.map { $0.pathString })
706706

707707
result.append("-I")
708708
result.append(buildParameters.buildPath.pathString)
@@ -831,7 +831,7 @@ public final class SwiftTargetBuildDescription {
831831
stream <<< " },\n"
832832

833833
// Write out the entries for each source file.
834-
let sources = target.sources.paths
834+
let sources = target.sources.paths + derivedSources.paths
835835
for (idx, source) in sources.enumerated() {
836836
let object = objects[idx]
837837
let objectDir = object.parentDirectory

Sources/Build/ManifestBuilder.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,6 @@ extension LLBuildManifestBuilder {
350350

351351
// Commands.
352352
try addExplicitBuildSwiftCmds(description, inputs: inputs,
353-
objectNodes: objectNodes,
354-
moduleNode: moduleNode,
355353
targetDepGraphMap: &targetDepGraphMap)
356354

357355
addTargetCmd(description, cmdOutputs: cmdOutputs)
@@ -360,8 +358,7 @@ extension LLBuildManifestBuilder {
360358

361359
private func addExplicitBuildSwiftCmds(
362360
_ targetDescription: SwiftTargetBuildDescription,
363-
inputs: [Node], objectNodes: [Node], moduleNode: Node,
364-
targetDepGraphMap: inout [ResolvedTarget: InterModuleDependencyGraph]
361+
inputs: [Node], targetDepGraphMap: inout [ResolvedTarget: InterModuleDependencyGraph]
365362
) throws {
366363
// Pass the driver its external dependencies (target dependencies)
367364
var targetDependencyMap: SwiftDriver.ExternalDependencyArtifactMap = [:]

0 commit comments

Comments
 (0)