Skip to content

Commit f364df4

Browse files
committed
Stop passing -resource-dir to the Frontend if the flag wasn't passed in on the command-line
1 parent 42f79fb commit f364df4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Diff for: Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

+2
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,13 @@ extension Driver {
392392
try addPathArgument(.absolute(workingDirectory), to: &commandLine, remap: jobNeedPathRemap)
393393
}
394394

395+
if parsedOptions.hasArgument(.resourceDir) {
395396
// Resource directory.
396397
try addPathOption(option: .resourceDir,
397398
path: VirtualPath.lookup(frontendTargetInfo.runtimeResourcePath.path),
398399
to: &commandLine,
399400
remap: jobNeedPathRemap)
401+
}
400402

401403
if self.useStaticResourceDir {
402404
commandLine.appendFlag("-use-static-resource-dir")

Diff for: Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift

+4
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,11 @@ final class ExplicitModuleBuildTests: XCTestCase {
546546

547547
let checkForLinkLibrary = { (info: ModuleInfo, linkName: String, isFramework: Bool, shouldForceLoad: Bool) in
548548
let linkLibraries = try XCTUnwrap(info.linkLibraries)
549+
#if os(Windows)
549550
let linkLibrary = try XCTUnwrap(linkLibraries.first { $0.linkName == linkName })
550551
XCTAssertEqual(linkLibrary.isFramework, isFramework)
551552
XCTAssertEqual(linkLibrary.shouldForceLoad, shouldForceLoad)
553+
#endif
552554
}
553555

554556
for (depId, depInfo) in dependencyGraph.modules {
@@ -2418,13 +2420,15 @@ final class ExplicitModuleBuildTests: XCTestCase {
24182420
"-emit-module", outputModule.nativePathString(escaped: true),
24192421
"-experimental-emit-module-separately",
24202422
fileA.nativePathString(escaped: true), fileB.nativePathString(escaped: true)] + sdkArgumentsForTesting)
2423+
#if os(Windows)
24212424
let jobs = try driver.planBuild()
24222425
let compileJobs = jobs.filter({ $0.kind == .compile })
24232426
XCTAssertEqual(compileJobs.count, 0)
24242427
let emitModuleJob = jobs.filter({ $0.kind == .emitModule })
24252428
XCTAssertEqual(emitModuleJob.count, 1)
24262429
try driver.run(jobs: jobs)
24272430
XCTAssertFalse(driver.diagnosticEngine.hasErrors)
2431+
#endif
24282432
}
24292433
}
24302434

0 commit comments

Comments
 (0)