File tree Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change 11
11
//===----------------------------------------------------------------------===//
12
12
13
13
extension Driver {
14
- func generateDSYMJob( inputs: [ TypedVirtualPath ] ) throws -> Job {
14
+ mutating func generateDSYMJob( inputs: [ TypedVirtualPath ] ) throws -> Job {
15
15
assert ( inputs. count == 1 )
16
16
let input = inputs [ 0 ]
17
- let outputPath = input. file. replacingExtension ( with: . dSYM)
17
+
18
+ // Output is final output file + `.dSYM`
19
+ let outputFile : VirtualPath
20
+ if let output = parsedOptions. getLastArgument ( . o) {
21
+ outputFile = try VirtualPath ( path: output. asSingle)
22
+ } else {
23
+ outputFile = outputFileForImage
24
+ }
25
+ let outputPath = try VirtualPath ( path: outputFile. description. appendingFileTypeExtension ( . dSYM) )
18
26
19
27
var commandLine = [ Job . ArgTemplate] ( )
20
28
commandLine. appendPath ( input. file)
Original file line number Diff line number Diff line change 12
12
import TSCBasic
13
13
14
14
extension Driver {
15
- private var relativeOutputFileForImage : RelativePath {
15
+ internal var relativeOutputFileForImage : RelativePath {
16
16
if inputFiles. count == 1 && moduleOutputInfo. nameIsFallback && inputFiles [ 0 ] . file != . standardInput {
17
17
return RelativePath ( inputFiles [ 0 ] . file. basenameWithoutExt)
18
18
}
@@ -24,7 +24,7 @@ extension Driver {
24
24
}
25
25
26
26
/// Compute the output file for an image output.
27
- private var outputFileForImage : VirtualPath {
27
+ internal var outputFileForImage : VirtualPath {
28
28
return useWorkingDirectory ( relativeOutputFileForImage)
29
29
}
30
30
Original file line number Diff line number Diff line change @@ -2859,6 +2859,17 @@ final class SwiftDriverTests: XCTestCase {
2859
2859
2860
2860
XCTAssertTrue ( cmd. contains ( . path( try VirtualPath ( path: " Test " ) ) ) )
2861
2861
}
2862
+
2863
+ do {
2864
+ // dSYM generation (-g) with specified output file name with an extension
2865
+ var driver = try Driver ( args: commonArgs + [ " -g " , " -o " , " a.out " ] )
2866
+ let plannedJobs = try driver. planBuild ( )
2867
+ let generateDSYMJob = plannedJobs. last!
2868
+ if driver. targetTriple. isDarwin {
2869
+ XCTAssertEqual ( plannedJobs. count, 5 )
2870
+ XCTAssertEqual ( generateDSYMJob. outputs. last? . file, try VirtualPath ( path: " a.out.dSYM " ) )
2871
+ }
2872
+ }
2862
2873
}
2863
2874
2864
2875
func testEmitModuleTrace( ) throws {
You can’t perform that action at this time.
0 commit comments