Skip to content

Commit

Permalink
Moves cirdl build output to 'build' folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
benbierens committed Sep 10, 2024
1 parent c9a090a commit 9433d9f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions build.nims
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mode = ScriptMode.Verbose

import std/os except commandLineParams

### Helper functions
proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") =
Expand All @@ -14,7 +15,11 @@ proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") =
for i in 2..<paramCount():
extra_params &= " " & paramStr(i)

let cmd = "nim " & lang & " --out:build/" & name & " " & extra_params & " " & srcDir & name & ".nim"
let
# Place build output in 'build' folder, even if name includes a longer path.
outName = os.lastPathPart(name)
cmd = "nim " & lang & " --out:build/" & outName & " " & extra_params & " " & srcDir & name & ".nim"

exec(cmd)

proc test(name: string, srcDir = "tests/", params = "", lang = "c") =
Expand All @@ -25,7 +30,7 @@ task codex, "build codex binary":
buildBinary "codex", params = "-d:chronicles_runtime_filtering -d:chronicles_log_level=TRACE"

task toolsCirdl, "build tools/cirdl binary":
buildBinary "tools/cirdl/cirdl", params = ""
buildBinary "tools/cirdl/cirdl"

task testCodex, "Build & run Codex tests":
test "testCodex", params = "-d:codex_enable_proof_failures=true"
Expand Down

0 comments on commit 9433d9f

Please sign in to comment.