aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Yakimowich-Payne <jyapayne@gmail.com>2018-07-08 22:43:17 +0900
committerJoey Yakimowich-Payne <jyapayne@gmail.com>2018-07-08 22:43:17 +0900
commit4c45a5f5b2a7e75da707f450c330a20d8126ae9b (patch)
tree97ac48cf7b09ef4e8c3062fb0c399127dd5a744f
parent2fc12b8577c42d7fb23e8f7d1fea2591ef0e5da9 (diff)
downloadnimgen-4c45a5f5b2a7e75da707f450c330a20d8126ae9b.tar.gz
nimgen-4c45a5f5b2a7e75da707f450c330a20d8126ae9b.zip
Combine passC and absolute imports
-rw-r--r--nimgen.nim9
1 files changed, 8 insertions, 1 deletions
diff --git a/nimgen.nim b/nimgen.nim
index 7137dcd..8693a7c 100644
--- a/nimgen.nim
+++ b/nimgen.nim
@@ -490,11 +490,18 @@ proc c2nim(fl, outfile: string, c2nimConfig: c2nimConfigObj) =
passC = "import strutils\n"
passC &= "import ospaths\n"
+ for inc in gIncludes:
+ let relativeInc = inc.replace(gOutput & $DirSep, "")
+ passC &= (
+ """{.passC: "-I\"" & currentSourcePath().splitPath().head & "/$#\"".}""" %
+ [relativeInc]
+ ) & "\n"
+
for prag in c2nimConfig.pragma:
outpragma &= "{." & prag & ".}\n"
let fname = file.splitFile().name.replace(re"[\.\-]", "_")
- let fincl = file.replace(gOutput, "")
+ let fincl = file.replace(gOutput & $DirSep, "")
if c2nimConfig.dynlib.len() != 0:
let