File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Sources/SwiftDriver/Driver Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -3014,10 +3014,21 @@ extension Driver {
30143014
30153015 // Emit-module discovered dependencies are always specified as a single-output
30163016 // file
3017- if type == . emitModuleDependencies,
3018- let singleOutputPath = outputFileMap? . existingOutputForSingleInput (
3019- outputType: type) {
3020- return singleOutputPath
3017+ if type == . emitModuleDependencies {
3018+ if let path = outputFileMap? . existingOutputForSingleInput ( outputType: type) {
3019+ return path
3020+ }
3021+
3022+ // If an explicit path is not provided by the output file map, attempt to
3023+ // synthesize a path from the master swift dependency path. This is
3024+ // important as we may other emit this file at the location where the
3025+ // driver was invoked, which is normally the root of the package.
3026+ if let path = outputFileMap? . existingOutputForSingleInput ( outputType: . swiftDeps) {
3027+ return VirtualPath . lookup ( path)
3028+ . parentDirectory
3029+ . appending ( component: " \( moduleName) . \( type. rawValue) " )
3030+ . intern ( )
3031+ }
30213032 }
30223033
30233034 // If there is an output argument, derive the name from there.
You can’t perform that action at this time.
0 commit comments