forked from multitheftauto/mtasa-blue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake5.lua
168 lines (143 loc) · 3.98 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
-- Add buildactions to path
premake.path = premake.path..";utils/buildactions"
require "compose_files"
require "install_data"
require "install_resources"
require "install_cef"
require "install_discord"
-- Set CI Build global
local ci = os.getenv("CI")
if ci and ci:lower() == "true" then
CI_BUILD = true
else
CI_BUILD = false
end
GLIBC_COMPAT = os.getenv("GLIBC_COMPAT") == "true"
workspace "MTASA"
configurations {"Debug", "Release", "Nightly"}
platforms { "x86", "x64"}
if os.host() == "macosx" then
removeplatforms { "x86" }
end
targetprefix ""
location "Build"
startproject "Client Launcher"
cppdialect "C++17"
characterset "MBCS"
pic "On"
symbols "On"
dxdir = os.getenv("DXSDK_DIR") or ""
includedirs {
"vendor",
"Shared/sdk",
}
defines {
"_CRT_SECURE_NO_WARNINGS",
"_SCL_SECURE_NO_WARNINGS",
"_CRT_NONSTDC_NO_DEPRECATE",
"NOMINMAX",
"_TIMESPEC_DEFINED"
}
-- Helper function for output path
buildpath = function(p) return "%{wks.location}/../Bin/"..p.."/" end
copy = function(p) return "{COPY} %{cfg.buildtarget.abspath} \"%{wks.location}../Bin/"..p.."/\"" end
if GLIBC_COMPAT then
filter { "system:linux" }
includedirs "/compat"
linkoptions "-static-libstdc++ -static-libgcc"
forceincludes { "glibc_version.h" }
filter { "system:linux", "platforms:x86" }
libdirs { "/compat/x86" }
filter { "system:linux", "platforms:x64" }
libdirs { "/compat/x64" }
end
filter "platforms:x86"
architecture "x86"
filter "platforms:x64"
architecture "x86_64"
filter "configurations:Debug"
defines { "MTA_DEBUG" }
targetsuffix "_d"
filter "configurations:Release or configurations:Nightly"
optimize "Speed" -- "On"=MS:/Ox GCC:/O2 "Speed"=MS:/O2 GCC:/O3 "Full"=MS:/Ox GCC:/O3
if CI_BUILD then
filter {}
defines { "CI_BUILD=1" }
filter { "system:linux" }
linkoptions { "-s" }
end
filter {"system:windows", "configurations:Nightly", "kind:not StaticLib"}
os.mkdir("Build/Symbols")
linkoptions "/PDB:\"Symbols\\$(ProjectName).pdb\""
filter "system:windows"
toolset "v142"
staticruntime "On"
defines { "WIN32", "_WIN32", "_WIN32_WINNT=0x601", "_MSC_PLATFORM_TOOLSET=$(PlatformToolsetVersion)" }
includedirs {
path.join(dxdir, "Include")
}
libdirs {
path.join(dxdir, "Lib/x86")
}
filter {"system:windows", "configurations:Debug"}
runtime "Release" -- Always use Release runtime
defines { "DEBUG" } -- Using DEBUG as _DEBUG is not available with /MT
filter "system:linux"
vectorextensions "SSE2"
buildoptions { "-fvisibility=hidden" }
-- Only build the client on Windows
if os.target() == "windows" then
group "Client"
include "Client/ceflauncher"
include "Client/ceflauncher_DLL"
include "Client/cefweb"
include "Client/core"
include "Client/game_sa"
include "Client/sdk"
include "Client/gui"
include "Client/launch"
include "Client/loader"
include "Client/multiplayer_sa"
include "Client/mods/deathmatch"
group "Client/CEGUI"
include "vendor/cegui-0.4.0-custom/src/renderers/directx9GUIRenderer"
include "vendor/cegui-0.4.0-custom/WidgetSets/Falagard"
include "vendor/cegui-0.4.0-custom"
group "Vendor"
include "vendor/portaudio"
include "vendor/cef3"
include "vendor/freetype"
include "vendor/jpeg-9d"
include "vendor/ksignals"
include "vendor/libpng"
include "vendor/tinygettext"
include "vendor/pthreads"
include "vendor/libspeex"
end
filter {}
group "Server"
include "Server/core"
include "Server/dbconmy"
include "Server/launcher"
include "Server/mods/deathmatch"
include "Server/sdk"
group "Shared"
include "Shared"
include "Shared/XML"
group "Vendor"
include "vendor/bcrypt"
include "vendor/cryptopp"
include "vendor/curl"
include "vendor/ehs"
include "vendor/google-breakpad"
include "vendor/hwbrk"
include "vendor/json-c"
include "vendor/lua"
include "vendor/mbedtls"
include "vendor/pcre"
include "vendor/pme"
include "vendor/sqlite"
include "vendor/tinyxml"
include "vendor/unrar"
include "vendor/zip"
include "vendor/zlib"