Skip to content

Commit 2af7acc

Browse files
authored
Merge pull request swiftlang#1279 from nkcsgexi/create-module-cache
PrebuiltModuleGen: create absent module cache directory
2 parents 38c9387 + 394c5bb commit 2af7acc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/swift-build-sdk-interfaces/main.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ do {
148148
if let mcp = getArgument(mcpFlag) {
149149
args.append(mcpFlag)
150150
args.append(mcp)
151+
// Create module cache dir if absent.
152+
let mcpPath = try VirtualPath(path: mcp).absolutePath!
153+
if !localFileSystem.exists(mcpPath) {
154+
try localFileSystem.createDirectory(mcpPath, recursive: true)
155+
}
151156
}
152157
let baselineABIDir = try getArgumentAsPath("-baseline-abi-dir")
153158
var driver = try Driver(args: args,

0 commit comments

Comments
 (0)