Skip to content

Commit b67e8ae

Browse files
committed
Pass resource directory through to -print-target-info.
1 parent 5ec3bb8 commit b67e8ae

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Sources/SwiftDriver/Driver/Driver.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,8 +1583,13 @@ extension Driver {
15831583
Triple($0, normalizing: true)
15841584
}
15851585

1586-
// FIXME: Compute these.
1587-
let resourceDirPath: VirtualPath? = nil
1586+
// Determine the resource directory.
1587+
let resourceDirPath: VirtualPath?
1588+
if let resourceDirArg = parsedOptions.getLastArgument(.resourceDir) {
1589+
resourceDirPath = try VirtualPath(path: resourceDirArg.asSingle)
1590+
} else {
1591+
resourceDirPath = nil
1592+
}
15881593

15891594
let toolchainType = try explicitTarget?.toolchainType(diagnosticsEngine) ??
15901595
defaultToolchainType

Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ extension Driver {
178178
commandLine.appendPath(.absolute(workingDirectory))
179179
}
180180

181+
// Resource directory.
182+
commandLine.appendFlag(.resourceDir)
183+
commandLine.appendPath(
184+
try AbsolutePath(validating: frontendTargetInfo.paths.runtimeResourcePath))
185+
181186
// -g implies -enable-anonymous-context-mangled-names, because the extra
182187
// metadata aids debugging.
183188
if parsedOptions.getLast(in: .g) != nil {

0 commit comments

Comments
 (0)