diff options
| author | Joey Yakimowich-Payne <jyapayne@gmail.com> | 2018-07-08 22:43:17 +0900 |
|---|---|---|
| committer | Joey Yakimowich-Payne <jyapayne@gmail.com> | 2018-07-08 22:43:17 +0900 |
| commit | 4c45a5f5b2a7e75da707f450c330a20d8126ae9b (patch) | |
| tree | 97ac48cf7b09ef4e8c3062fb0c399127dd5a744f | |
| parent | 2fc12b8577c42d7fb23e8f7d1fea2591ef0e5da9 (diff) | |
| download | nimgen-4c45a5f5b2a7e75da707f450c330a20d8126ae9b.tar.gz nimgen-4c45a5f5b2a7e75da707f450c330a20d8126ae9b.zip | |
Combine passC and absolute imports
| -rw-r--r-- | nimgen.nim | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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 |
