summary refs log tree commit diff stats
path: root/koch.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-02-24 14:46:45 +0100
committerAraq <rumpf_a@web.de>2015-02-24 19:19:08 +0100
commitf3756d2ccb6059c4b2a51e8565df0fcd7d8a57d5 (patch)
tree64ca00f166563a687a710d2bdd0c4ac8b3361c4c /koch.nim
parent4ab0cf20feca724ee6fc6e29b8cf92924ba548ce (diff)
downloadNim-f3756d2ccb6059c4b2a51e8565df0fcd7d8a57d5.tar.gz
koch supports 'boot cpp'
Diffstat (limited to 'koch.nim')
-rw-r--r--koch.nim7
1 files changed, 3 insertions, 4 deletions
diff --git a/koch.nim b/koch.nim
index 535dae5ba..d365262c1 100644
--- a/koch.nim
+++ b/koch.nim
@@ -139,9 +139,6 @@ proc pdf(args="") =
 
 # -------------- boot ---------------------------------------------------------
 
-const
-  bootOptions = "" # options to pass to the bootstrap process
-
 proc findStartNim: string = 
   # we try several things before giving up:
   # * bin/nim
@@ -180,11 +177,13 @@ proc thVersion(i: int): string =
 proc boot(args: string) =
   var output = "compiler" / "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)
   for i in 0..2:
     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):
       copyExe(output, finalDest)
       echo "executables are equal: SUCCESS!"