koch.nim: Make bootstrapping in C++ mode robust
This commit is contained in:
parent
8947779dd0
commit
2039dad273
1 changed files with 6 additions and 4 deletions
10
koch.nim
10
koch.nim
|
|
@ -277,14 +277,16 @@ proc boot(args: string) =
|
||||||
var output = "compiler" / "nim".exe
|
var output = "compiler" / "nim".exe
|
||||||
var finalDest = "bin" / "nim".exe
|
var finalDest = "bin" / "nim".exe
|
||||||
# default to use the 'c' command:
|
# default to use the 'c' command:
|
||||||
let defaultCommand = if getEnv("NIM_COMPILE_TO_CPP", "false") == "true": "cpp" else: "c"
|
let useCpp = getEnv("NIM_COMPILE_TO_CPP", "false") == "true"
|
||||||
let bootOptions = if args.len == 0 or args.startsWith("-"): defaultCommand else: ""
|
|
||||||
echo "boot: defaultCommand: ", defaultCommand, " bootOptions: ", bootOptions
|
|
||||||
let smartNimcache = (if "release" in args: "nimcache/r_" else: "nimcache/d_") &
|
let smartNimcache = (if "release" in args: "nimcache/r_" else: "nimcache/d_") &
|
||||||
hostOs & "_" & hostCpu
|
hostOs & "_" & hostCpu
|
||||||
|
|
||||||
copyExe(findStartNim(), 0.thVersion)
|
copyExe(findStartNim(), 0.thVersion)
|
||||||
for i in 0..2:
|
for i in 0..2+ord(useCpp):
|
||||||
|
# do the first iteration in C mode in order to avoid problem #10315:
|
||||||
|
let defaultCommand = if useCpp and i > 0: "cpp" else: "c"
|
||||||
|
let bootOptions = if args.len == 0 or args.startsWith("-"): defaultCommand else: ""
|
||||||
|
|
||||||
echo "iteration: ", i+1
|
echo "iteration: ", i+1
|
||||||
let extraOption = if i == 0:
|
let extraOption = if i == 0:
|
||||||
"--skipUserCfg --skipParentCfg"
|
"--skipUserCfg --skipParentCfg"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue