Skip to content

Commit 012962e

Browse files
authored
Merge pull request #844 from artemcm/55WorkaroundClangCodePathEMB
[5.5][Explicit Module Builds] Use new form of `-fmodule-file` to work around Clang issue with explicit builds and emit-PCH
2 parents 98ac213 + cb1de0b commit 012962e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/SwiftDriver/ExplicitModuleBuilds/ExplicitDependencyBuildPlanner.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ public typealias ExternalTargetModuleDetailsMap = [ModuleDependencyId: ExternalT
288288
TypedVirtualPath(file: moduleArtifactInfo.moduleMapPath.path,
289289
type: .clangModuleMap)
290290
commandLine.appendFlags("-Xcc", "-Xclang", "-Xcc",
291-
"-fmodule-file=\(clangModulePath.file.description)")
291+
"-fmodule-file=\(moduleArtifactInfo.moduleName)=\(clangModulePath.file.description)")
292292
commandLine.appendFlags("-Xcc", "-Xclang", "-Xcc",
293293
"-fmodule-map-file=\(clangModuleMapPath.file.description)")
294294
inputs.append(clangModulePath)

Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private func checkExplicitModuleBuildJobDependencies(job: Job,
129129
XCTAssertTrue(job.inputs.contains(clangDependencyModulePath))
130130
XCTAssertTrue(job.inputs.contains(clangDependencyModuleMapPath))
131131
XCTAssertTrue(job.commandLine.contains(
132-
.flag(String("-fmodule-file=\(clangDependencyModulePathString)"))))
132+
.flag(String("-fmodule-file=\(dependencyId.moduleName)=\(clangDependencyModulePathString)"))))
133133
XCTAssertTrue(job.commandLine.contains(
134134
.flag(String("-fmodule-map-file=\(clangDependencyDetails.moduleMapPath.path.description)"))))
135135
case .swiftPlaceholder(_):

0 commit comments

Comments
 (0)