-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
config.nims
52 lines (45 loc) · 1.63 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
switch("styleCheck", "error")
hint("Name", on)
warning("BareExcept", off)
warning("ProveInit", off)
warning("Uninit", off)
switch("experimental", "strictDefs")
switch("experimental", "strictFuncs")
switch("define", "nimStrictDelete")
switch("mm", "refc")
# Replace the stdlib JSON modules with our own stricter versions.
patchFile("stdlib", "json", "src/patched_stdlib/json")
patchFile("stdlib", "parsejson", "src/patched_stdlib/parsejson")
if defined(zig) and findExe("zigcc").len > 0:
switch("cc", "clang")
# We can't write `zig cc` below, because the value cannot contain a space.
switch("clang.exe", "zigcc")
switch("clang.linkerexe", "zigcc")
const target {.strdefine.} = ""
if target.len > 0:
switch("passC", "-target " & target)
switch("passL", "-target " & target)
if defined(release):
switch("opt", "size")
if not (defined(zig) and defined(macosx)):
# `zig ld` doesn't support LTO.
# See https://github.com/ziglang/zig/issues/8680
switch("passC", "-flto")
switch("passL", "-flto")
if defined(linux) or defined(windows):
switch("passL", "-s")
switch("passL", "-static")
if defined(linux) and not defined(zig):
if defined(gcc):
switch("gcc.exe", "musl-gcc")
switch("gcc.linkerexe", "musl-gcc")
elif defined(clang):
switch("clang.exe", "musl-clang")
switch("clang.linkerexe", "musl-clang")
# Tell Nim the paths to Nimble packages. We need this because we ran `nimble lock`.
# The below lines are added by `nimble setup`.
# begin Nimble config (version 2)
--noNimblePath
when withDir(thisDir(), system.fileExists("nimble.paths")):
include "nimble.paths"
# end Nimble config