-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtundra.lua
executable file
·125 lines (119 loc) · 3.52 KB
/
tundra.lua
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
-- MSVC /analyze is very slow, so we don't want it turned on all the time,
-- which is why we keep a separate SubVariant called "analyze"
-- How to build and test with afl?
-- Uncomment the afl Config down below, in the Configs section
-- export LD_LIBRARY_PATH=`pwd`/t2-output/linux-afl-release-default
-- ../afl-2.51b/afl-fuzz -m 200 -i testdata/fuzz-vdom-diff -o findings -- t2-output/linux-afl-release-default/Test fuzz-vdom-diff
local win_linker = {
{ "/NXCOMPAT /DYNAMICBASE /DEBUG:FASTLINK"; Config = "win*" },
{ "/DEBUG"; Config = "win*-*-debug" },
{ "/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF /RELEASE"; Config = "win*-*-release" },
}
local unix_common = {
Env = {
CXXOPTS = {
{ "-std=c++11" },
{ "-fPIC" },
{ "-ggdb" },
},
CCOPTS = {
{ "-fPIC" },
{ "-ggdb" },
},
}
}
local win_common = {
Env = {
PROGOPTS = win_linker,
SHLIBOPTS = win_linker,
GENERATE_PDB = {
{ "1"; Config = "win*" },
},
INCREMENTAL = {
{ "1"; Config = "win*-*-debug" },
},
CXXOPTS = {
{ "/analyze /WX"; Config = "win*-*-*-analyze" },
{ "/EHsc"; Config = "win*" },
{ "/W3"; Config = "win*" },
{ "/wd4251"; Config = "win*" }, -- class needs to have DLL-interface...
{ "/wd6387"; Config = "win*" }, -- 'data' could be '0': this does not adhere to the specification for the function 'foo'
{ "/Gm-"; Config = "win*" },
{ "/GS"; Config = "win*" },
{ "/RTC1"; Config = "win*-*-debug" },
{ "/Ox"; Config = "win*-*-release" },
{ "/arch:SSE2"; Config = "win32-*" },
{ "/openmp"; Config = "win*" },
-- { "/Zc:inline"; Config = "win*" }, -- This requires VC 2013 Update 2, but it's really just a compiler/linker performance improvement.
},
CPPDEFS = {
{ "_DEBUG"; Config = "win*-*-debug" },
{ "NOMINMAX"; Config = "win*" },
},
},
}
Build {
ScriptDirs = { "build" }, -- Allow tundra to find our afl toolchain inside build/tundra/tools/afl.lua
Units = "units.lua",
Passes= {
PchGen = { Name = "Precompiled Header Generation", BuildOrder = 1 },
},
Variants = { "debug", "release" },
SubVariants = { "default", "analyze" },
DefaultSubVariant = "default",
Configs = {
{
Name = "macosx-gcc",
DefaultOnHost = "macosx",
Tools = { "gcc" },
},
{
Name = "linux-clang",
DefaultOnHost = "linux",
Inherit = unix_common,
Tools = { "clang" },
},
-- See instructions at top of file for using afl (American Fuzzy Lop fuzzer).
{
Name = "linux-afl",
SupportedHosts = { "linux" },
Inherit = unix_common,
Tools = { "afl" },
},
{
Name = "win32-msvc2015",
SupportedHosts = { "windows" },
Inherit = win_common,
Tools = { {"msvc-vs2015"; TargetArch = "x86"} },
},
{
Name = "win64-msvc2015",
DefaultOnHost = "windows",
Inherit = win_common,
Tools = { {"msvc-vs2015"; TargetArch = "x64"} },
},
},
IdeGenerationHints = {
Msvc = {
-- Remap config names to MSVC platform names (affects things like header scanning & debugging)
PlatformMappings = {
['win64-msvc2015'] = 'x64',
['win32-msvc2015'] = 'Win32',
},
-- Remap variant names to MSVC friendly names
VariantMappings = {
['release-default'] = 'Release',
['debug-default'] = 'Debug',
['release-analyze'] = 'Release Analyze',
['debug-analyze'] = 'Debug Analyze',
},
},
-- Override solutions to generate and what units to put where.
MsvcSolutions = {
['xo.sln'] = {}, -- receives all the units due to empty set
},
-- Override output directory for sln/vcxproj files.
MsvcSolutionDir = 'ide',
BuildAllByDefault = true,
},
}