Skip to content

Commit 0d7d866

Browse files
committed
Generate empty module map if needed
1 parent 60b7a5c commit 0d7d866

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Sources/Build/describe().swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@ public func describe(prefix: String, _ conf: Configuration, _ modules: [Module],
108108
//FIXME: Incremental builds
109109
//FIXME: Add support for executables
110110
for case let module as ClangModule in modules {
111+
112+
//FIXME: Generate modulemaps if possible
113+
//Since we're not generating modulemaps currently we'll just emit empty module map file
114+
//if it not present
115+
if !module.path.isFile {
116+
try mkdir(module.path.parentDirectory)
117+
try fopen(module.path, mode: .Write) { fp in
118+
try fputs("\n", fp)
119+
}
120+
}
121+
111122
let inputs = module.dependencies.map{ $0.targetName } + module.sources.paths
112123
let productPath = Path.join(prefix, "\(module.c99name).o")
113124
let wd = Path.join(prefix, "\(module.c99name).build")

0 commit comments

Comments
 (0)