Skip to content

Commit

Permalink
Fixes #9154 (#9193)
Browse files Browse the repository at this point in the history
  • Loading branch information
manterolat authored and Araq committed Oct 10, 2018
1 parent 462bff4 commit 16a941a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/cgen.nim
Expand Up @@ -1635,6 +1635,9 @@ proc cgenWriteModules*(backend: RootRef, config: ConfigRef) =
# deps are allowed (and the system module is processed in the wrong
# order anyway)
g.config = config
let (outDir, _, _) = splitFile(config.outfile)
if not outDir.isEmpty:
createDir(outDir)
if g.generatedHeader != nil: finishModule(g.generatedHeader)
while g.forwardedProcsCounter > 0:
for m in cgenModules(g):
Expand Down
3 changes: 3 additions & 0 deletions compiler/jsgen.nim
Expand Up @@ -2345,6 +2345,9 @@ proc myClose(graph: ModuleGraph; b: PPassContext, n: PNode): PNode =
else: AbsoluteFile(getCurrentDir() / m.config.outFile.string)
else:
changeFileExt(completeCFilePath(m.config, AbsoluteFile f), ext)
let (outDir, _, _) = splitFile(outfile)
if not outDir.isEmpty:
createDir(outDir)
discard writeRopeIfNotEqual(genHeader() & code, outfile)
for obj, content in items(globals.classes):
genClass(m.config, obj, content, ext)
Expand Down

0 comments on commit 16a941a

Please sign in to comment.