From 4c45a5f5b2a7e75da707f450c330a20d8126ae9b Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Sun, 8 Jul 2018 22:43:17 +0900 Subject: Combine passC and absolute imports --- nimgen.nim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3