aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2019-07-19 19:38:41 -0500
committerGanesh Viswanathan <dev@genotrance.com>2019-07-19 19:38:41 -0500
commit547ee5801ec01ba9363b8de2a0f173bd824e4a24 (patch)
tree66218ac06428914adb13ca1a5b5fc0af80956bb8
parent79c64d5186728b3683760ac2611d9935d002d280 (diff)
downloadnimterop-547ee5801ec01ba9363b8de2a0f173bd824e4a24.tar.gz
nimterop-547ee5801ec01ba9363b8de2a0f173bd824e4a24.zip
Minor c2nim fixes
-rw-r--r--nimterop/cimport.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/nimterop/cimport.nim b/nimterop/cimport.nim
index a4e1761..1249ee9 100644
--- a/nimterop/cimport.nim
+++ b/nimterop/cimport.nim
@@ -586,7 +586,8 @@ macro c2nImport*(filename: static string, recurse: static bool = false, dynlib:
doAssert fileExists(hpath), "Unable to write temporary header file: " & hpath
var
- cmd = &"c2nim {hpath} --header:{header}"
+ cmd = when defined(Windows): "cmd /c " else: ""
+ cmd &= &"c2nim {hpath} --header:{header}"
if dynlib.len != 0:
cmd.add &" --dynlib:{dynlib}"
@@ -600,7 +601,7 @@ macro c2nImport*(filename: static string, recurse: static bool = false, dynlib:
let
(c2nimout, ret) = gorgeEx(cmd, cache=getCacheValue(hpath))
- doAssert ret == 0, c2nimout
+ doAssert ret == 0, "Command failed:\n " & cmd
var
nimout = &"const {header} = \"{fullpath}\"\n\n" & readFile(npath)