summary refs log tree commit diff stats
path: root/compiler/cgen.nim
diff options
context:
space:
mode:
authormanterolat <manterolat@users.noreply.github.com>2018-10-10 08:17:28 -0300
committerAndreas Rumpf <rumpf_a@web.de>2018-10-10 13:17:28 +0200
commit16a941a64206d7727cd1971559bfeea70ccc952f (patch)
tree371e75d621a3340b0a335058544305d2b3419260 /compiler/cgen.nim
parent462bff48b22adf1415232e6da74698c69c88e949 (diff)
downloadNim-16a941a64206d7727cd1971559bfeea70ccc952f.tar.gz
Fixes #9154 (#9193)
Diffstat (limited to 'compiler/cgen.nim')
-rw-r--r--compiler/cgen.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim
index 250044601..918bec0f9 100644
--- a/compiler/cgen.nim
+++ b/compiler/cgen.nim
@@ -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):