Fix nimconf path to nim
This commit is contained in:
parent
e32fd4d1d2
commit
80cfc99dcd
5 changed files with 15 additions and 10 deletions
|
|
@ -139,7 +139,7 @@ proc newConstDef(gState: State, node: TSNode, fname = "", fval = ""): PNode =
|
||||||
else:
|
else:
|
||||||
gecho &"# const '{origname}' is duplicate, skipped"
|
gecho &"# const '{origname}' is duplicate, skipped"
|
||||||
else:
|
else:
|
||||||
gecho &"# const '{origname}' has unsupported value '{val}'"
|
gecho &"# const '{origname}' has unsupported value '{val.strip()}'"
|
||||||
gState.skippedSyms.incl origname
|
gState.skippedSyms.incl origname
|
||||||
|
|
||||||
proc addConst(gState: State, node: TSNode) =
|
proc addConst(gState: State, node: TSNode) =
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ type
|
||||||
var
|
var
|
||||||
gDebug* = false
|
gDebug* = false
|
||||||
gDebugCT* {.compileTime.} = false
|
gDebugCT* {.compileTime.} = false
|
||||||
|
gNimExe* = ""
|
||||||
|
|
||||||
proc echoDebug(str: string) =
|
proc echoDebug(str: string) =
|
||||||
let str = "\n# " & str.strip().replace("\n", "\n# ")
|
let str = "\n# " & str.strip().replace("\n", "\n# ")
|
||||||
|
|
@ -46,6 +47,14 @@ proc sanitizePath*(path: string, noQuote = false, sep = $DirSep): string =
|
||||||
if not noQuote:
|
if not noQuote:
|
||||||
result = result.quoteShell
|
result = result.quoteShell
|
||||||
|
|
||||||
|
proc getCurrentNimCompiler*(): string =
|
||||||
|
when nimvm:
|
||||||
|
result = getCurrentCompilerExe()
|
||||||
|
when defined(nimsuggest):
|
||||||
|
result = result.replace("nimsuggest", "nim")
|
||||||
|
else:
|
||||||
|
result = gNimExe
|
||||||
|
|
||||||
# Nim cfg file related functionality
|
# Nim cfg file related functionality
|
||||||
include "."/nimconf
|
include "."/nimconf
|
||||||
|
|
||||||
|
|
@ -64,11 +73,6 @@ proc getNimteropCacheDir(): string =
|
||||||
# Get location to cache all nimterop artifacts
|
# Get location to cache all nimterop artifacts
|
||||||
result = getNimcacheDir() / "nimterop"
|
result = getNimcacheDir() / "nimterop"
|
||||||
|
|
||||||
proc getCurrentNimCompiler*(): string =
|
|
||||||
result = getCurrentCompilerExe()
|
|
||||||
when defined(nimsuggest):
|
|
||||||
result = result.replace("nimsuggest", "nim")
|
|
||||||
|
|
||||||
proc execAction*(cmd: string, retry = 0, die = true, cache = false,
|
proc execAction*(cmd: string, retry = 0, die = true, cache = false,
|
||||||
cacheKey = ""): tuple[output: string, ret: int] =
|
cacheKey = ""): tuple[output: string, ret: int] =
|
||||||
## Execute an external command - supported at compile time
|
## Execute an external command - supported at compile time
|
||||||
|
|
|
||||||
|
|
@ -454,7 +454,7 @@ proc loadPlugin*(gState: State, sourcePath: string) =
|
||||||
outflags = &"--out:\"{pdll}\""
|
outflags = &"--out:\"{pdll}\""
|
||||||
|
|
||||||
# Compile plugin as library with `markAndSweep` GC
|
# Compile plugin as library with `markAndSweep` GC
|
||||||
cmd = &"{gState.nim.sanitizePath} c --app:lib --gc:markAndSweep {flags} {outflags} {sourcePath.sanitizePath}"
|
cmd = &"{gState.nim} c --app:lib --gc:markAndSweep {flags} {outflags} {sourcePath.sanitizePath}"
|
||||||
|
|
||||||
discard execAction(cmd)
|
discard execAction(cmd)
|
||||||
doAssert fileExists(pdll), "No plugin binary generated for " & sourcePath
|
doAssert fileExists(pdll), "No plugin binary generated for " & sourcePath
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ type
|
||||||
proc getJson(projectDir: string): JsonNode =
|
proc getJson(projectDir: string): JsonNode =
|
||||||
# Get `nim dump` json value for `projectDir`
|
# Get `nim dump` json value for `projectDir`
|
||||||
var
|
var
|
||||||
cmd = "nim --hints:off --dump.format:json dump dummy"
|
cmd = &"{getCurrentNimCompiler()} --hints:off --dump.format:json dump dummy"
|
||||||
dump = ""
|
dump = ""
|
||||||
ret = 0
|
ret = 0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ proc main(
|
||||||
feature: feature,
|
feature: feature,
|
||||||
includeDirs: includeDirs,
|
includeDirs: includeDirs,
|
||||||
mode: mode,
|
mode: mode,
|
||||||
nim: nim,
|
nim: nim.sanitizePath,
|
||||||
noComments: noComments,
|
noComments: noComments,
|
||||||
noHeader: noHeader,
|
noHeader: noHeader,
|
||||||
past: past,
|
past: past,
|
||||||
|
|
@ -79,7 +79,8 @@ proc main(
|
||||||
)
|
)
|
||||||
|
|
||||||
# Set gDebug in build.nim
|
# Set gDebug in build.nim
|
||||||
build.gDebug = debug
|
build.gDebug = gState.debug
|
||||||
|
build.gNimExe = gState.nim
|
||||||
|
|
||||||
# Default `ast` mode
|
# Default `ast` mode
|
||||||
if gState.feature.Bl:
|
if gState.feature.Bl:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue