diff options
| -rw-r--r-- | nimterop/build.nim | 5 | ||||
| -rw-r--r-- | nimterop/cimport.nim | 4 | ||||
| -rw-r--r-- | nimterop/toast.nim | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/nimterop/build.nim b/nimterop/build.nim index bd0a0b1..69cbe95 100644 --- a/nimterop/build.nim +++ b/nimterop/build.nim @@ -29,6 +29,11 @@ proc getOsCacheDir(): string = proc getNimteropCacheDir(): string = result = getOsCacheDir() / "nimterop" +proc getCurrentNimCompiler*(): string = + result = getCurrentCompilerExe() + when defined(nimsuggest): + result = result.replace("nimsuggest", "nim") + proc execAction*(cmd: string, retry = 0, die = true, cache = false, cacheKey = ""): tuple[output: string, ret: int] = ## Execute an external command - supported at compile time diff --git a/nimterop/cimport.nim b/nimterop/cimport.nim index 6b2d153..4c63c31 100644 --- a/nimterop/cimport.nim +++ b/nimterop/cimport.nim @@ -115,7 +115,7 @@ proc getNimCheckError(output: string): tuple[tmpFile, errors: string] = let (check, _) = execAction( - &"{getCurrentCompilerExe()} check {result.tmpFile.sanitizePath}", + &"{getCurrentNimCompiler()} check {result.tmpFile.sanitizePath}", die = false ) @@ -153,7 +153,7 @@ proc getToast(fullpath: string, recurse: bool = false, dynlib: string = "", if gStateCT.symOverride.nBl: cmd.add &" --symOverride={gStateCT.symOverride.join(\",\")}" - cmd.add &" --nim:{getCurrentCompilerExe().sanitizePath}" + cmd.add &" --nim:{getCurrentNimCompiler().sanitizePath}" if gStateCT.pluginSourcePath.nBl: cmd.add &" --pluginSourcePath={gStateCT.pluginSourcePath.sanitizePath}" diff --git a/nimterop/toast.nim b/nimterop/toast.nim index 5923e56..c26b460 100644 --- a/nimterop/toast.nim +++ b/nimterop/toast.nim @@ -198,7 +198,7 @@ proc main( if gState.pnim and check: # Run nim check on generated wrapper var - (check, err) = execCmdEx(&"{getCurrentCompilerExe()} check {outputFile}") + (check, err) = execCmdEx(&"{gState.nim} check {outputFile}") if err != 0: # Failed check so try stubbing if stub: @@ -233,7 +233,7 @@ proc main( outputFile.writeFile(data) # Rerun nim check on stubbed wrapper - (check, err) = execCmdEx(&"{getCurrentCompilerExe()} check {outputFile}") + (check, err) = execCmdEx(&"{gState.nim} check {outputFile}") doAssert err == 0, "# Nim check with stub failed:\n\n" & check else: doAssert err == 0, "# Nim check failed:\n\n" & check |
