koch supports 'boot cpp'
This commit is contained in:
parent
4ab0cf20fe
commit
f3756d2ccb
1 changed files with 3 additions and 4 deletions
7
koch.nim
7
koch.nim
|
|
@ -139,9 +139,6 @@ proc pdf(args="") =
|
||||||
|
|
||||||
# -------------- boot ---------------------------------------------------------
|
# -------------- boot ---------------------------------------------------------
|
||||||
|
|
||||||
const
|
|
||||||
bootOptions = "" # options to pass to the bootstrap process
|
|
||||||
|
|
||||||
proc findStartNim: string =
|
proc findStartNim: string =
|
||||||
# we try several things before giving up:
|
# we try several things before giving up:
|
||||||
# * bin/nim
|
# * bin/nim
|
||||||
|
|
@ -180,11 +177,13 @@ proc thVersion(i: int): string =
|
||||||
proc boot(args: string) =
|
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:
|
||||||
|
let bootOptions = if args.len == 0 or args.startsWith("-"): "c" else: ""
|
||||||
|
|
||||||
copyExe(findStartNim(), 0.thVersion)
|
copyExe(findStartNim(), 0.thVersion)
|
||||||
for i in 0..2:
|
for i in 0..2:
|
||||||
echo "iteration: ", i+1
|
echo "iteration: ", i+1
|
||||||
exec i.thVersion & " c $# $# compiler" / "nim.nim" % [bootOptions, args]
|
exec i.thVersion & " $# $# compiler" / "nim.nim" % [bootOptions, args]
|
||||||
if sameFileContent(output, i.thVersion):
|
if sameFileContent(output, i.thVersion):
|
||||||
copyExe(output, finalDest)
|
copyExe(output, finalDest)
|
||||||
echo "executables are equal: SUCCESS!"
|
echo "executables are equal: SUCCESS!"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue