Add configurable compiler to global section
This commit is contained in:
parent
a8bcbf8e89
commit
0f73ad6d3f
1 changed files with 8 additions and 1 deletions
|
|
@ -7,6 +7,8 @@ var
|
||||||
gConfig: Config
|
gConfig: Config
|
||||||
gFilter = ""
|
gFilter = ""
|
||||||
gQuotes = true
|
gQuotes = true
|
||||||
|
gCppCompiler = "g++"
|
||||||
|
gCCompiler = "gcc"
|
||||||
gOutput = ""
|
gOutput = ""
|
||||||
gIncludes: seq[string] = @[]
|
gIncludes: seq[string] = @[]
|
||||||
gExcludes: seq[string] = @[]
|
gExcludes: seq[string] = @[]
|
||||||
|
|
@ -369,7 +371,7 @@ proc getDefines(file: string, inline=false): string =
|
||||||
|
|
||||||
proc runPreprocess(file, ppflags, flags: string, inline: bool): string =
|
proc runPreprocess(file, ppflags, flags: string, inline: bool): string =
|
||||||
var
|
var
|
||||||
pproc = if flags.contains("cpp"): "g++" else: "gcc"
|
pproc = if flags.contains("cpp"): gCppCompiler else: gCCompiler
|
||||||
cmd = "$# -E $# $#" % [pproc, ppflags, file]
|
cmd = "$# -E $# $#" % [pproc, ppflags, file]
|
||||||
|
|
||||||
for inc in gIncludes:
|
for inc in gIncludes:
|
||||||
|
|
@ -671,6 +673,11 @@ proc runCfg(cfg: string) =
|
||||||
quit(1)
|
quit(1)
|
||||||
createDir(gOutput)
|
createDir(gOutput)
|
||||||
|
|
||||||
|
if gConfig["n.global"].hasKey("cpp_compiler"):
|
||||||
|
gCppCompiler = gConfig["n.global"]["cpp_compiler"]
|
||||||
|
if gConfig["n.global"].hasKey("c_compiler"):
|
||||||
|
gCCompiler = gConfig["n.global"]["c_compiler"]
|
||||||
|
|
||||||
if gConfig["n.global"].hasKey("filter"):
|
if gConfig["n.global"].hasKey("filter"):
|
||||||
gFilter = gConfig["n.global"]["filter"]
|
gFilter = gConfig["n.global"]["filter"]
|
||||||
if gConfig["n.global"].hasKey("quotes"):
|
if gConfig["n.global"].hasKey("quotes"):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue