Add check for absolute directories

This commit is contained in:
Joey Yakimowich-Payne 2018-07-08 22:56:36 +09:00
commit 512cdd3a9f

View file

@ -491,6 +491,9 @@ proc c2nim(fl, outfile: string, c2nimConfig: c2nimConfigObj) =
passC &= "import ospaths\n" passC &= "import ospaths\n"
for inc in gIncludes: for inc in gIncludes:
if inc.isAbsolute:
passC &= ("""{.passC: "-I\"$#\"".}""" % [inc]) & "\n"
else:
let relativeInc = inc.replace(gOutput, "") let relativeInc = inc.replace(gOutput, "")
passC &= ( passC &= (
"""{.passC: "-I\"" & currentSourcePath().splitPath().head & "/$#\"".}""" % """{.passC: "-I\"" & currentSourcePath().splitPath().head & "/$#\"".}""" %