-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathconfig.nims
87 lines (63 loc) · 2.15 KB
/
config.nims
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
84
85
86
import std/macros
import ospaths
import std/strformat
import std/strutils
const Release = true
const libs_dir = "libs"
const output_dir = "dist"
const src_dir = "src"
const nimble_path = libs_dir&"/nimble"
template require(package: untyped) =
block:
var pack_to_install {.inject.} = astToStr(package)
if (astToStr(package))[0] == '\"':
pack_to_install[0] = ' '
pack_to_install[pack_to_install.high()] = ' '
pack_to_install = pack_to_install.replace("\\\"", "\"")
exec fmt"nimble -l install --nimbleDir:{nimble_path} {pack_to_install} -y"
task install, "install deps":
require zippy
require nimAES
require stew
require jsony
require secp256k1
require ndns
task build_server, "builds server":
let backend = "c"
let output_dir_target = output_dir
const output_file_name = "FTT"&(when defined(windows): ".exe" else: "")
setCommand("c", src_dir&"/main.nim")
switch("nimblePath", nimble_path&"/pkgs")
var output = output_dir_target / output_file_name
switch("mm", "orc")
switch("warning", "BareExcept:off")
# switch("cc", "clang")
# switch("path", src_dir&"/packages")
switch("path", src_dir)
switch("path", libs_dir)
switch("passC", "-I "&libs_dir&"/hwinfo/include/")
# switch("define","asyncBackend=asyncdispatch")
# switch("define", "logGC")
switch("define", "ssl")
# switch("passC", "-static-libstdc++")
when Release:
switch("opt", "speed")
switch("debugger", "off")
switch("d", "release")
switch("passL", " -s")
switch("debuginfo", "off")
switch("passC", "-DNDEBUG")
# switch("assertions", "off")
# switch("checks", "off")
# switch("passL", " -static")
# switch("passL", " -static-libgcc")
# switch("passL", " -static-libstdc++")
switch("backend", backend)
switch("outdir", output_dir_target)
switch("out", output)
task build, "builds all":
echo staticExec "pkill FTT"
exec "nim build_server"
withDir(output_dir):
exec "chmod +x FTT"
# echo staticExec "./FTT >> output.log 2>&1"