-
Notifications
You must be signed in to change notification settings - Fork 14
/
premake5.lua
181 lines (160 loc) · 4.15 KB
/
premake5.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
include "tools/scripts/folders.lua"
include "tools/scripts/including.lua"
include "tools/scripts/linking.lua"
include "tools/scripts/options.lua"
include "tools/scripts/platform.lua"
include "tools/scripts/version.lua"
-- ==================
-- Workspace
-- ==================
workspace "OpenAssetTools"
location "build"
objdir "%{wks.location}/obj"
symbols "On"
systemversion "latest"
cppdialect "C++20"
largeaddressaware "on"
flags {
"MultiProcessorCompile"
}
configurations {
"Debug",
"Release"
}
platforms {
"x86",
"x64"
}
defaultplatform "x86"
disablewarnings {
"26812" -- Prefer enum class over unscoped
}
filter "platforms:x86"
architecture "x86"
defines "ARCH_x86"
filter {}
filter "platforms:x64"
architecture "x86_64"
defines "ARCH_x64"
filter {}
filter "configurations:Debug"
defines "_DEBUG"
optimize "Debug"
symbols "On"
filter {}
filter "configurations:Release"
defines "NDEBUG"
optimize "Full"
symbols "Off"
flags {
"FatalWarnings"
}
filter {}
defines {
"__STDC_LIB_EXT1__",
"__STDC_WANT_LIB_EXT1__=1",
"_CRT_SECURE_NO_WARNINGS"
}
-- Write the current version to a header
-- This is better than adding it as macro here since changing a global macro would cause a full rebuild
WriteVersionHeader()
includedirs {
GetVersionHeaderFolder()
}
filter "options:debug-structureddatadef"
defines { "STRUCTUREDDATADEF_DEBUG" }
filter {}
filter "options:debug-techset"
defines { "TECHSET_DEBUG" }
filter {}
-- ========================
-- ThirdParty
-- ========================
include "thirdparty/catch2.lua"
include "thirdparty/eigen.lua"
include "thirdparty/libtomcrypt.lua"
include "thirdparty/libtommath.lua"
include "thirdparty/json.lua"
include "thirdparty/minilzo.lua"
include "thirdparty/minizip.lua"
include "thirdparty/salsa20.lua"
include "thirdparty/zlib.lua"
-- ThirdParty group: All projects that are external dependencies
group "ThirdParty"
catch2:project()
eigen:project()
libtommath:project()
libtomcrypt:project()
json:project()
minilzo:project()
minizip:project()
salsa20:project()
zlib:project()
group ""
-- ========================
-- Projects
-- ========================
include "src/Common.lua"
include "src/Crypto.lua"
include "src/Linker.lua"
include "src/Parser.lua"
include "src/RawTemplater.lua"
include "src/Unlinker.lua"
include "src/Utils.lua"
include "src/ZoneCode.lua"
include "src/ZoneCodeGeneratorLib.lua"
include "src/ZoneCodeGenerator.lua"
include "src/ZoneCommon.lua"
include "src/ZoneLoading.lua"
include "src/ZoneWriting.lua"
include "src/ZoneCommon.lua"
include "src/ObjCommon.lua"
include "src/ObjLoading.lua"
include "src/ObjWriting.lua"
include "tools/scripts/raw.lua"
-- Components group: All projects assist or are part of a tool
group "Components"
Common:project()
Crypto:project()
Parser:project()
Utils:project()
ZoneCode:project()
ZoneCodeGeneratorLib:project()
ZoneCommon:project()
ZoneLoading:project()
ZoneWriting:project()
ObjCommon:project()
ObjLoading:project()
ObjWriting:project()
group ""
-- Tools group: All projects that compile into the final tools
group "BuildTools"
RawTemplater:project()
ZoneCodeGenerator:project()
group ""
-- Tools group: All projects that compile into the final tools
group "Tools"
Linker:project()
Unlinker:project()
group ""
group "Raw"
Raw:project()
group ""
-- ========================
-- Tests
-- ========================
include "test/ObjCommonTests.lua"
include "test/ObjLoadingTests.lua"
include "test/ParserTestUtils.lua"
include "test/ParserTests.lua"
include "test/ZoneCodeGeneratorLibTests.lua"
include "test/ZoneCommonTests.lua"
-- Tests group: Unit test and other tests projects
group "Tests"
ObjCommonTests:project()
ObjLoadingTests:project()
ParserTestUtils:project()
ParserTests:project()
ZoneCodeGeneratorLibTests:project()
ZoneCommonTests:project()
group ""