-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpremake5.lua
More file actions
216 lines (178 loc) · 5.98 KB
/
premake5.lua
File metadata and controls
216 lines (178 loc) · 5.98 KB
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
--
-- premake5 file to build NavBot extension.
-- http://premake.github.io/
--
local action = _ACTION or ""
local todir = "premake_build/" .. action
newoption {
trigger = "hl2sdk-root",
value = "absolute path",
description = "Absolute path to the root folter that contains the HL2-SDKs",
category = "Paths"
}
newoption {
trigger = "mms-path",
value = "absolute path",
description = "Absolute path to the root metamod-source folder",
category = "Paths"
}
newoption {
trigger = "sm-path",
value = "absolute path",
description = "Absolute path to the root sourcemod folder",
category = "Paths"
}
newoption {
trigger = "instructions-set",
value = "empty or sse2 or sse4 or avx2",
description = "Allows the compiler to use SSE4 or AVX2 instructions. SSE2 is the default.",
category = "compilers"
}
newoption {
trigger = "valve-prof",
description = "Enables VPROF.",
category = "BuildOptions"
}
newoption {
trigger = "no-sourcepawn-api",
description = "Disables the SourcePawn API.",
category = "BuildOptions"
}
Path_HL2SDKROOT = ""
Path_SM = ""
Path_MMS = ""
-- when "premake5 --help" is ran, _ACTION is NULL (nil)
if (_ACTION ~= nil) then
if (_OPTIONS["hl2sdk-root"] == nil) then
error("Failed to get path to HL2SDKs. Set path with --hl2sdk-root=path")
end
if (_OPTIONS["mms-path"] == nil) then
error("Failed to get path to Metamod Source. Set path with --mms-path=path")
end
if (_OPTIONS["sm-path"] == nil) then
error("Failed to get path to SourceMod. Set path with --sm-path=path")
end
if (not os.isdir(_OPTIONS["hl2sdk-root"])) then
error("Failed to get path to HL2SDKs. Set path with --hl2sdk-root=path")
end
if (not os.isdir(_OPTIONS["mms-path"])) then
error("Failed to get path to Metamod Source. Set path with --mms-path=path")
end
if (not os.isdir(_OPTIONS["sm-path"])) then
error("Failed to get path to SourceMod. Set path with --sm-path=path")
end
Path_HL2SDKROOT = path.normalize(_OPTIONS["hl2sdk-root"])
Path_SM = path.normalize(_OPTIONS["sm-path"])
Path_MMS = path.normalize(_OPTIONS["mms-path"])
end
workspace "navbot"
configurations {
"Debug",
"Release"
}
if os.host() == "windows" then
platforms {
"Win32",
"Win64"
}
end
if os.host() == "linux" then
platforms {
"Linux32",
"Linux64"
}
end
location (todir)
symbols "On"
exceptionhandling "On"
rtti "On"
stringpooling "On"
omitframepointer "Off"
vectorextensions "SSE2"
pic "On"
include("premake/common_sdk.lua")
filter { "options:instructions-set=avx2" }
vectorextensions "AVX2"
filter { "options:instructions-set=sse4" }
vectorextensions "SSE4.2"
filter { "options:valve-prof" }
defines { "EXT_VPROF_ENABLED" }
filter { "options:no-sourcepawn-api" }
defines { "NO_SOURCEPAWN_API" }
filter { "system:Windows" }
toolset "msc"
clangtidy("On")
runcodeanalysis("On")
defines { "_CRT_SECURE_NO_DEPRECATE", "_CRT_SECURE_NO_WARNINGS", "_CRT_NONSTDC_NO_DEPRECATE", "_WINDOWS", "_ITERATOR_DEBUG_LEVEL=0" }
multiprocessorcompile "on"
characterset "MBCS"
staticruntime "on"
runtime "Release"
editandcontinue "off"
-- Disable macro redefinition warnings
disablewarnings { "4005"}
links {
"kernel32.lib",
"user32.lib",
"legacy_stdio_definitions.lib",
}
-- Linux options shared for both GCC/Clang
filter { "system:Linux" }
toolset "clang"
defines { "LINUX", "_LINUX", "POSIX", "_FILE_OFFSET_BITS=64", "COMPILER_GCC" }
defines { "stricmp=strcasecmp", "_stricmp=strcasecmp", "_snprintf=snprintf", "_vsnprintf=vsnprintf", "HAVE_STDINT_H", "GNUC" }
buildoptions {
"-Wno-non-virtual-dtor", "-Wno-overloaded-virtual", "-Wno-register", "-Wno-varargs", "-Wno-array-bounds", "-Wno-unused",
"-Wno-null-dereference", "-Wno-delete-non-virtual-dtor", "-Wno-switch", "-Wno-expansion-to-defined",
}
-- disable prefixes for Linux
targetprefix ""
if os.host() == "linux" then
visibility "Hidden"
end
-- Linux options for Clang only
filter { "system:linux", "toolset:clang" }
buildoptions {
"-Wno-implicit-exception-spec-mismatch", "-Wno-sometimes-uninitialized", "-Wno-inconsistent-missing-override", "-Wno-tautological-overlap-compare",
"-Wno-implicit-float-conversion",
}
filter {}
defines { "NOMINMAX" }
filter { "configurations:Debug" }
defines { "EXT_DEBUG" }
targetdir "build/bin/%{cfg.architecture}/debug"
optimize "Off"
filter { "configurations:Release" }
defines { "NDEBUG" }
targetdir "build/bin/%{cfg.architecture}/release"
optimize "Full"
linktimeoptimization "On"
filter { "platforms:Win32" }
system "Windows"
architecture "x86"
defines { "WIN32", "COMPILER_MSVC", "COMPILER_MSVC32" }
filter { "platforms:Win64" }
system "Windows"
architecture "x86_64"
defines { "WIN32", "WIN64", "COMPILER_MSVC", "COMPILER_MSVC64", "X64BITS" }
filter { "platforms:Linux32" }
system "Linux"
architecture "x86"
filter { "platforms:Linux64" }
system "Linux"
architecture "x86_64"
defines { "X64BITS" }
-- reset filter
filter {}
include("premake/tf2.lua")
include("premake/dods.lua")
include("premake/css.lua")
include("premake/csgo.lua")
include("premake/bms.lua")
include("premake/sdk2013.lua")
include("premake/hl2dm.lua")
include("premake/orangebox.lua")
include("premake/episode1.lua")
include("premake/l4d.lua")
include("premake/l4d2.lua")
include("premake/swarm.lua")