-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.nims.end
60 lines (53 loc) · 1.57 KB
/
config.nims.end
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
# Set compiler options
case TC
of "vcc" , "clang_cl":
switch "define","lto"
of "zigcc":
discard
else:
if "" == findExe(TC): # GCC is default compiler if TC dosn't exist on the PATH
echo "#### Set to cc = ",TC
TC = "gcc"
if "" == findExe(TC): # if gcc dosn't exist, try clang
TC = "clang"
echo "#### Set to cc = ",TC
# Reduce code size further
when false:
#switch "mm","arc" # nim-1.6.8 or later
switch "gc", "arc"
switch "define", "useMalloc"
switch "define", "noSignalHandler"
#switch "panics","on"
#switch "verbosity","1"
proc commonOpt() = # for gcc and clang
# switch "passL", "-s" # remov debug info from elf file
switch "passC", "-ffunction-sections"
switch "passC", "-fdata-sections"
switch "passL", "-Wl,--gc-sections"
#const NIMCACHE = ".nimcache_" & TC
switch "nimcache", ".nimcache"
case TC
of "gcc":
commonOpt()
switch "cc",TC
of "clang":
switch "cc.exe","clang"
switch "cc.linkerexe","clang"
switch "cc",TC
of "zigcc": # Only Windows
switch "cc","clang"
var ext = ""
when defined(windows):
ext = ".bat"
switch "clang.exe","../zigcc.bat" #& ext
switch "clang.linkerexe","../zigcc.bat" #& ext
switch "passL","-lgcc_s "
of "vcc":
switch "cc",TC
switch "passL","/Zc:strictStrings-" # Eliminates C2440 error at C++. Notice: TODO
switch "passC","/MP"
when LTO: # These options let link time slow while reducing code size.
switch "define", "lto"
echo ""
echo "#### [ ", TC, " ] Compiler ####"
echo ""