-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpremake5.lua
More file actions
144 lines (117 loc) · 3.41 KB
/
premake5.lua
File metadata and controls
144 lines (117 loc) · 3.41 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
workspace "AzureFlare"
location "./build/"
startproject "psobb"
targetdir "%{wks.location}/bin/%{cfg.buildcfg}/"
objdir "%{wks.location}/obj/%{cfg.buildcfg}/%{prj.name}/"
buildlog "%{wks.location}/obj/%{cfg.buildcfg}/%{prj.name}.log"
toolset "gcc"
architecture "x86"
--[[
Set the prefix only in Linux, as we build using the
MinGW32 console on Windows
]]--
filter "system:not windows"
gccprefix "i686-w64-mingw32-"
filter {}
configurations { "Debug", "Release" }
platforms { "x86" }
buildoptions {
"-std=c++17",
"-msse2", -- was vectorextensions "sse2"
"-finput-charset=UTF-8", -- was /utf-8
"-fexec-charset=UTF-8",
"-march=i486", -- XP hardware safety floor
}
links {
"dbghelp",
}
linkoptions {
"-Wl,--large-address-aware", -- /LARGEADDRESSAWARE
"-Wa,-mbig-obj",
"-Wl,--major-subsystem-version,5,--minor-subsystem-version,1",
"-Wl,--major-os-version,5,--minor-os-version,1",
-- Static instructions
"-static",
"-static-libgcc",
"-static-libstdc++",
"-lpthread",
"-Wl,-Map=%{wks.location}/bin/%{cfg.buildcfg}/%{cfg.targetname}.map",
}
defines {
"NOMINMAX",
"WIN32_LEAN_AND_MEAN",
"UNICODE",
"_UNICODE",
}
filter "configurations:Release"
defines "NDEBUG"
optimize "Size"
symbols "Off"
buildoptions { "-ffunction-sections", "-fdata-sections", "-flto" }
linkoptions {
"-flto", -- /LTCG (Link phase)
"-Wl,--gc-sections", -- /OPT:REF
-- "-Wl,--icf=all", -- /OPT:ICF
"-Wl,--no-keep-memory",
-- "-v",
}
filter {}
filter "configurations:Debug"
defines "DEBUG"
optimize "Debug"
symbols "On"
filter {}
project "psobb"
targetname "wsock32"
language "C++"
kind "SharedLib"
warnings "Off"
targetextension ".dll"
forceincludes { "stdafx.hh" }
links {
"minhook",
"polar_common",
}
linkoptions {
path.getabsolute("./src/psobb/resources/wsock32.def"),
"-Wl,--enable-stdcall-fixup", -- Required for the server redirection
}
files { "./src/psobb/**/*.cc", "./src/psobb/resources/wsock32.def" }
includedirs {
"./src/psobb/",
"./src/common/include/",
"./deps/minhook/include/",
}
filter "configurations:Release"
linkoptions {
"-Wl,--exclude-all-symbols",
}
filter {}
-- Include the license on build
postbuildcommands {
"cp %[LICENSE.txt] %{wks.location}/bin/%{cfg.buildcfg}/LICENSE.txt",
"cp %[psobb.cfg] %{wks.location}/bin/%{cfg.buildcfg}/psobb.cfg",
}
project "polar_common"
kind "StaticLib"
language "C++"
warnings "Off"
forceincludes { "header/stdafx.hh" }
files {
"./src/common/**/*.cc",
}
links {
"dbghelp"
}
includedirs {
"./src/common/include/"
}
project "minhook"
kind "StaticLib"
language "C++"
warnings "Off"
files {
"./deps/minhook/src/**.c"
}
-- Required by the library
postbuildcommands { "cp %[deps/minhook/LICENSE.txt] %{wks.location}/bin/%{cfg.buildcfg}/LICENSE.minhook.txt" }