Minor c2nim fixes
This commit is contained in:
parent
79c64d5186
commit
547ee5801e
1 changed files with 3 additions and 2 deletions
|
|
@ -586,7 +586,8 @@ macro c2nImport*(filename: static string, recurse: static bool = false, dynlib:
|
||||||
doAssert fileExists(hpath), "Unable to write temporary header file: " & hpath
|
doAssert fileExists(hpath), "Unable to write temporary header file: " & hpath
|
||||||
|
|
||||||
var
|
var
|
||||||
cmd = &"c2nim {hpath} --header:{header}"
|
cmd = when defined(Windows): "cmd /c " else: ""
|
||||||
|
cmd &= &"c2nim {hpath} --header:{header}"
|
||||||
|
|
||||||
if dynlib.len != 0:
|
if dynlib.len != 0:
|
||||||
cmd.add &" --dynlib:{dynlib}"
|
cmd.add &" --dynlib:{dynlib}"
|
||||||
|
|
@ -600,7 +601,7 @@ macro c2nImport*(filename: static string, recurse: static bool = false, dynlib:
|
||||||
|
|
||||||
let
|
let
|
||||||
(c2nimout, ret) = gorgeEx(cmd, cache=getCacheValue(hpath))
|
(c2nimout, ret) = gorgeEx(cmd, cache=getCacheValue(hpath))
|
||||||
doAssert ret == 0, c2nimout
|
doAssert ret == 0, "Command failed:\n " & cmd
|
||||||
|
|
||||||
var
|
var
|
||||||
nimout = &"const {header} = \"{fullpath}\"\n\n" & readFile(npath)
|
nimout = &"const {header} = \"{fullpath}\"\n\n" & readFile(npath)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue