File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Sources/SwiftDriver/Driver Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1374,7 +1374,10 @@ extension Driver {
1374
1374
} else if moduleOutputKind == . topLevel {
1375
1375
// FIXME: Logic to infer from primary outputs, etc.
1376
1376
let moduleFilename = moduleName. appendingFileTypeExtension ( . swiftModule)
1377
- if let outputArg = parsedOptions. getLastArgument ( . o) ? . asSingle, let lastSeparatorIndex = outputArg. lastIndex ( of: " / " ) {
1377
+ if let outputArg = parsedOptions. getLastArgument ( . o) ? . asSingle, compilerOutputType == . swiftModule {
1378
+ // If the module is the primary output, match -o exactly if present.
1379
+ moduleOutputPath = try . init( path: outputArg)
1380
+ } else if let outputArg = parsedOptions. getLastArgument ( . o) ? . asSingle, let lastSeparatorIndex = outputArg. lastIndex ( of: " / " ) {
1378
1381
// Put the module next to the top-level output.
1379
1382
moduleOutputPath = try . init( path: outputArg [ outputArg. startIndex... lastSeparatorIndex] + moduleFilename)
1380
1383
} else {
You can’t perform that action at this time.
0 commit comments