-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnmoo.nimble
83 lines (63 loc) · 2.39 KB
/
nmoo.nimble
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Package
version = "0.1.0"
author = "Sidharth Kulkarni"
description = "[TODO: CHANGE]"
license = "MIT"
srcDir = "src"
binDir = "bin"
bin = @["nmoo"]
skipFiles = @["sidechtest.nim"]
# Dependencies
requires "nim >= 1.16.4"
requires "bcrypt"
requires "nimboost"
requires "asynctools"
const coverage = getEnv("NMOO_COVERAGE") == "1"
const debugBuild = getEnv("NMOO_DEBUG") == "1"
const releaseBuild = getEnv("NMOO_RELEASE") == "1"
const estpProfiler = getEnv("NMOO_PROFILE") == "default"
const hottieProfiler = getEnv("NMOO_PROFILE") == "hottie"
const useGcAssert = getEnv("NMOO_GC_ASSERT") == "1"
proc getBuildFlags(): string =
result &= " --legacy:laxEffects"
result &= " --mm:orc --deepcopy:on"
# without this we get weird ORC segfaults
result &= " -d:useMalloc"
if debugBuild:
result &= " -d:debug"
result &= " --debugger:native"
if releaseBuild:
result &= " -d:release -d:danger"
if estpProfiler:
result &= " -d:profiler --profiler:on --stacktrace:on"
if hottieProfiler:
result &= " --debugger:native -d:release -d:danger --passL:\"-no-pie\""
if useGcAssert:
result &= " -d:useGcAssert"
task test, "Run tests":
var compilerParams: string
if coverage:
let gccParams = "'-ftest-coverage -fprofile-arcs'"
compilerParams &= " --passC:" & gccParams &
" --passL:" & gccParams &
" --nimcache:./nimcache"
compilerParams &= getBuildFlags()
exec "nim c -r " & compilerParams & " -o:bin/test src/nmoo/test.nim"
task serve, "Run the server":
var compilerParams = getBuildFlags()
compilerParams &= " -d:includeWizardUtils"
exec "nim c -r " & compilerParams & " -o:bin/server src/nmoo.nim"
task sccli, "Build the side channel CLI":
var compilerParams = getBuildFlags()
compilerParams &= " -d:includeWizardUtils"
exec "nim c " & compilerParams & " -o:bin/sccli src/nmoo/schanlib/eval.nim"
task neval, "Build the evaluation CLI":
var compilerParams = getBuildFlags()
compilerParams &= " -d:includeWizardUtils"
exec "nim c " & compilerParams & " -d:dumpTaskCode -d:singleStepTasks -o:bin/neval src/nmoo/util/eval.nim"
task serveHttp, "Run the http server":
var compilerParams: string
compilerParams &= getBuildFlags()
exec "nim c -r " & compilerParams & " -o:bin/httpd src/nmoo/httpd/httpd.nim"
task docs, "Generate builtin function documentation":
exec "nim c -r src/nmoo/doc/builtindocgen.nim"