forked from noahehall/nim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.nims
95 lines (91 loc) · 2.57 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
87
88
89
90
91
92
93
94
95
# --colors:on # breaks vscode run code extension
# --experimental:codeReordering dont use or fear the amount of logs it produces
# FYI: hint/warningAsError requires switch() syntax
--assertions:off
--checks:on
--debugger:native
--deepcopy:on # required for mm:orc/arc
--define:nimStrictDelete
--define:release
--define:ssl
--define:threadsafe
--errorMax:1
--experimental:strictEffects
--forceBuild:on
--hints:on
--mm:orc
--multimethods:on
--panics:on
--parallelBuild:0
--stackTraceMsgs:off
--styleCheck:error # can push specific pragmas, e.g. hint[Name]:off
--threads:on
--tlsEmulation:on
--unitsep:on # ASCII unit separator between error msgs
--verbosity:0
--warnings:on
switch("hint","GlobalVar:off") # spams u to death
switch("hintAsError", "DuplicateModuleImport:on")
switch("hintAsError", "Performance:on")
switch("hintAsError", "XDeclaredButNotUsed:on")
switch("warningAsError", "ConfigDeprecated:on")
switch("warningAsError", "Deprecated:on")
switch("warningAsError", "GcUnsafe:on")
switch("warningAsError", "HoleEnumConv:on")
switch("warningAsError", "ResultUsed:on")
switch("warningAsError", "UnusedImport:on")
case getCommand():
of "c", "cc", "cpp", "objc":
--lineDir:on
--lineTrace:on
--stackTrace:on
else: discard
case getEnv "ENV":
of "DEV":
--assertions:on
--debuginfo:on
--declaredLocs:on
--define:debug
--errorMax:0
--excessiveStackTrace:on
--forceBuild:off
--opt:size
--showAllMismatches:on
--stackTraceMsgs:on
--verbosity:2
switch("hintAsError", "XDeclaredButNotUsed:off")
switch("warningAsError", "Deprecated:off")
switch("warningAsError", "HoleEnumConv:off")
of "PERF":
--danger
of "SIZE":
# @see https://github.com/ee7/binary-size
--checks:off
--opt:size
--passC:"-flto"
--passL:"-flto"
of "SPEED":
--checks:off
--opt:speed
--passC:"-flto"
--passL:"-s"
else: discard
case existsEnv "CI":
of true:
--parallelBuild:1
--verbosity:2
else: discard
when (NimMajor, NimMinor, NimPatch) <= (1,6,12):
# throws in v2, maybe its no longer experimental?
--experimental:implicitDeref
# throws on nim source code
# @see https://github.com/nim-lang/Nim/issues/21713
switch("hintAsError", "DuplicateModuleImport:off")
switch("hintAsError", "Performance:off")
switch("hintAsError", "XDeclaredButNotUsed:off")
switch("warningAsError", "Deprecated:off")
switch("warningAsError", "HoleEnumConv:off") # only in ci on nim source
switch("warningAsError", "UnusedImport:off") # only in ci on nim source
else:
--define:futureLogging
switch("warningAsError", "CastSizes:on")