summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-10-18 10:58:28 +0200
committerAraq <rumpf_a@web.de>2018-10-18 10:58:28 +0200
commitd2ca8081060c0de9ab56d38f17a1a315661bdff8 (patch)
tree21b83700761ba3a5e48d541e8d9c1e8edf86bea1
parent505571f31ca2b9c1d26bf01ccf0a83375e67a7e4 (diff)
downloadNim-d2ca8081060c0de9ab56d38f17a1a315661bdff8.tar.gz
koch: bootstrap with C++ for NIM_COMPILE_TO_CPP env var
-rw-r--r--koch.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/koch.nim b/koch.nim
index c6f28f870..a77f5cc3a 100644
--- a/koch.nim
+++ b/koch.nim
@@ -272,7 +272,8 @@ 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: ""
+  let defaultCommand = if getEnv("NIM_COMPILE_TO_CPP", "false") == "true": "cpp" else: "c"
+  let bootOptions = if args.len == 0 or args.startsWith("-"): defaultCommand else: ""
   let smartNimcache = (if "release" in args: "nimcache/r_" else: "nimcache/d_") &
                       hostOs & "_" & hostCpu