add nimCompile to simplify koch; add nimfind to koch tools (#9723)

This commit is contained in:
Timothee Cour 2018-11-15 11:32:31 -08:00 • committed by Andreas Rumpf
commit 2eb14bdd41
3 changed files with 29 additions and 20 deletions

View file

@ -52,8 +52,18 @@ proc execCleanPath*(cmd: string,
putEnv("PATH", prevPath)
proc nimexec*(cmd: string) =
# Consider using `nimCompile` instead
exec findNim() & " " & cmd
proc nimCompile*(input: string, outputDir = "bin", mode = "c", options = "") =
# TODO: simplify pending https://github.com/nim-lang/Nim/issues/9513
var cmd = findNim() & " " & mode
let output = outputDir / input.splitFile.name.exe
cmd.add " -o:" & output
cmd.add " " & options
cmd.add " " & input
exec cmd
const
pdf = """
doc/manual.rst

2
tools/nimfind.nims Normal file
View file

@ -0,0 +1,2 @@
--define:nimfind
--define:nimcore