forked from Black-Tek/BlackTek-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake5.lua
151 lines (127 loc) · 4.6 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
workspace "Black-Tek-Server"
configurations { "Debug", "Release"}
platforms { "64", "ARM64", "ARM" }
location ""
editorintegration "On"
project "Black-Tek-Server"
kind "ConsoleApp"
language "C++"
cppdialect "C++20"
targetdir "%{wks.location}"
objdir "build/%{cfg.buildcfg}/obj"
location ""
files { "src/**.cpp", "src/**.h" }
flags {"MultiProcessorCompile"}
enableunitybuild "On"
intrinsics "On"
editandcontinue "Off"
newoption {
trigger = "lua",
description = "Specific Lua library to use. For example lua5.4. Useful if the packaged lua does not provide a symbolic liblua.so",
value = "libname",
category = "BlackTek", -- Group options together
default = "lua",
allowed = {
{"lua", "Default"},
{"lua5.4", "Use Lua 5.4"},
{"lua5.3", "Use Lua 5.3"},
}
}
newoption {
trigger = "custom-includes",
description = "A comma separated list of custom include paths.",
value = "include paths",
category = "BlackTek", -- Group options together
}
newoption {
trigger = "custom-libs",
description = "A comma separated list of custom library paths.",
value = "library paths",
category = "BlackTek", -- Group options together
}
newoption {
trigger = "verbose",
description = "Show warnings during compilation.",
category = "BlackTek" -- Group options together
}
if _OPTIONS["custom-includes"] then
includedirs { string.explode(_OPTIONS["custom-includes"], ",") }
end
if _OPTIONS["custom-libs"] then
libdirs { string.explode(_OPTIONS["custom-libs"], ",") }
end
filter "configurations:Debug"
defines { "DEBUG" }
runtime "Debug"
symbols "On"
optimize "Debug"
flags {"NoIncrementalLink"}
filter {}
filter "configurations:Release"
defines { "NDEBUG" }
runtime "Release"
symbols "Off"
optimize "Full"
filter {}
filter "platforms:64"
architecture "x86_64"
filter {}
filter "platforms:ARM64"
architecture "ARM64"
filter {}
filter "platforms:ARM"
architecture "ARM"
filter {}
filter "system:not windows"
buildoptions { "-Wall", "-Wextra", "-pedantic", "-pipe", "-fvisibility=hidden", "-Wno-unused-local-typedefs" }
linkoptions{"-flto=auto"}
flags {}
filter {}
filter "system:windows"
openmp "On"
characterset "MBCS"
linkoptions {"/IGNORE:4099"}
buildoptions {"/bigobj"}
vsprops { VcpkgEnableManifest = "true" }
symbolspath '$(OutDir)$(TargetName).pdb'
filter {}
filter "architecture:amd64"
vectorextensions "AVX"
filter{}
filter {"system:linux", "options:verbose"}
linkoptions { "-v" }
warnings "Extra"
filter {}
filter { "system:linux", "not options:verbose" }
warnings "Off"
filter {}
filter { "system:linux", "architecture:ARM" }
-- Paths to vcpkg installed dependencies
libdirs { "vcpkg_installed/arm-linux/lib", "/usr/arm-linux-gnueabihf" }
includedirs { "vcpkg_installed/arm-linux/include", "/usr/arm-linux-gnueabihf" }
filter{}
filter { "system:linux", "architecture:ARM64" }
-- Paths to vcpkg installed dependencies
libdirs { "vcpkg_installed/arm64-linux/lib", "/usr/arm-linux-gnueabi" }
includedirs { "vcpkg_installed/arm64-linux/include", "/usr/arm-linux-gnueabi" }
filter{}
filter { "system:linux", "architecture:amd64" }
-- Paths to vcpkg installed dependencies
libdirs { "vcpkg_installed/x64-linux/lib" }
includedirs { "vcpkg_installed/x64-linux/include" }
filter{}
filter "system:linux"
-- Common Linux paths
libdirs { "/usr/lib" }
includedirs { "/usr/include", "/usr/include/lua5.*" }
links { "pugixml", _OPTIONS["lua"], "fmt", "mariadb", "cryptopp", "boost_iostreams", "zstd", "z", "curl", "ssl", "crypto" }
filter{}
filter "toolset:gcc"
buildoptions { "-fno-strict-aliasing" }
filter {}
filter "toolset:clang"
buildoptions { "-Wimplicit-fallthrough", "-Wmove" }
filter {}
filter { "system:macosx", "action:gmake" }
buildoptions { "-fvisibility=hidden" }
filter {}