Skip to content

Commit f0295d9

Browse files
committed
Resolve PR comments
1 parent a3a857d commit f0295d9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Sources/SwiftDriver/Driver/Driver.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,7 @@ extension Driver {
18551855
return path
18561856
}
18571857

1858-
return path.replacingExtension(with: type)
1858+
return path.parentDirectory.appending(component: "\(moduleName).\(type.rawValue)")
18591859
}
18601860

18611861
return try VirtualPath(path: moduleName.appendingFileTypeExtension(type))
@@ -1954,12 +1954,15 @@ extension Driver {
19541954
_ = parsedOptions.hasArgument(isOutput)
19551955
}
19561956

1957+
let parentPath: VirtualPath
19571958
if let projectDirectory = projectDirectory {
19581959
// If the build system has created a Project dir for us to include the file, use it.
1959-
return projectDirectory.appending(component: moduleName.appendingFileTypeExtension(type))
1960+
parentPath = projectDirectory
1961+
} else {
1962+
parentPath = moduleOutputPath.parentDirectory
19601963
}
19611964

1962-
return moduleOutputPath.replacingExtension(with: type)
1965+
return parentPath.appending(component: moduleName).replacingExtension(with: type)
19631966
}
19641967

19651968
// If the output option was not provided, don't produce this output at all.

0 commit comments

Comments
 (0)