-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake5.lua
161 lines (139 loc) · 4.37 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
newoption {
trigger = "toolset",
value = "Toolset (eg. gcc, clang, msc)",
description = "The toolset to use to compile with",
default = os.host() == "windows" and "msc" or "gcc",
allowed = {
{ "gcc", "gcc and g++ using ld and ar" },
{ "clang", "clang and clang++ using lld and llvm-ar" },
{ "msc", "msbuild and cl using link.exe" }
}
}
newoption {
trigger = "target",
value = "Platform (eg. windows, linux)",
description = "The target platform to compile to",
default = os.host(),
allowed = {
{ "windows", "Windows system" },
{ "linux", "Unix-based systems" }
}
}
newoption {
trigger = "config",
value = "Configuration",
description = "The configuration to compile",
default = "debug",
allowed = {
{ "debug", "Debug build with symbols turned on" },
{ "debugoptimized", "Debug build with symbols and optimizations turned on" },
{ "release", "Release build without symbols, but with optimizations" }
}
}
newoption {
trigger = "unity",
description = "Create a unity build. Recommended for full compilation"
}
newoption {
trigger = "standalone",
description = "Standalone executable build"
}
require "Scripts/build"
require "Scripts/clean"
require "Scripts/unity"
outputdir = "%{cfg.buildcfg}-%{_OPTIONS['target']}-%{_OPTIONS['toolset']}-%{cfg.architecture}"
IncludeDir = {}
IncludeDir["bullet"] = "../Mahakam/vendor/bullet/src"
IncludeDir["bullet_dynamics"] = "../Mahakam/vendor/bullet/src/BulletDynamics"
IncludeDir["bullet_collision"] = "../Mahakam/vendor/bullet/src/BulletCollision"
IncludeDir["linear_math"] = "../Mahakam/vendor/bullet/src/LinearMath"
IncludeDir["entt"] = "../Mahakam/vendor/entt/include"
IncludeDir["glfw"] = "../Mahakam/vendor/glfw/include"
IncludeDir["glad"] = "../Mahakam/vendor/glad/include"
IncludeDir["glm"] = "../Mahakam/vendor/glm"
IncludeDir["glslang"] = "../Mahakam/vendor/glslang"
IncludeDir["imgui"] = "../Mahakam/vendor"
IncludeDir["imguizmo"] = "../Mahakam/vendor"
IncludeDir["ktl"] = "../Mahakam/vendor/ktl"
IncludeDir["magic_enum"] = "../Mahakam/vendor"
IncludeDir["miniaudio"] = "../Mahakam/vendor/miniaudio/include"
IncludeDir["ryml"] = "../Mahakam/vendor/ryml/include"
IncludeDir["spdlog"] = "../Mahakam/vendor/spdlog/include"
IncludeDir["spirv_cross"] = "../Mahakam/vendor/spirv_cross/include"
IncludeDir["stb_image"] = "../Mahakam/vendor/stb_image"
IncludeDir["steamaudio"] = "../Mahakam/vendor/steamaudio/include"
IncludeDir["tiny_gltf"] = "../Mahakam/vendor/tiny_gltf"
SteamAudioLibDir = "../Mahakam/vendor/steamaudio/lib/".._OPTIONS["target"].."-x64"
VendorIncludes = {
"src",
"../Mahakam/src",
"%{IncludeDir.entt}",
"%{IncludeDir.glm}",
"%{IncludeDir.imgui}",
"%{IncludeDir.imguizmo}",
"%{IncludeDir.ktl}",
"%{IncludeDir.magic_enum}",
"%{IncludeDir.ryml}",
"%{IncludeDir.spdlog}"
}
VendorLibDirs = {
SteamAudioLibDir
}
VendorLinks = {
"Mahakam",
"BulletDynamics",
"BulletCollision",
"LinearMath",
"GLFW",
"glad",
"glslang",
"ImGui",
"ImGuizmo",
"spirv_cross",
"phonon"
}
-- MinGW requires some extra links
if (os.host() == linux and _OPTIONS["target"] == "windows") then
MinGWLinks = {
"gdi32",
"dwmapi",
"comdlg32"
}
end
-- X11 and unix-specific stuff
LinuxLinks = {
"Xrandr",
"Xi",
--"GLU",
--"GL",
"X11",
"dl",
"pthread",
"stdc++fs" --GCC versions 5.3 through 8.x need stdc++fs for std::filesystem
}
workspace "Mahakam"
architecture "x64"
startproject(_OPTIONS["standalone"] and "Sandbox" or "Erebor")
toolset(_OPTIONS["toolset"])
configurations {
"Debug",
"DebugOptimized",
"Release"
}
filter "toolset:clang"
linkoptions { "-fuse-ld=lld" }
filter {}
group "Dependencies"
include "Mahakam/vendor/glfw"
include "Mahakam/vendor/imgui"
include "Mahakam/vendor/imguizmo"
include "Mahakam/vendor/glad"
include "Mahakam/vendor/glslang"
include "Mahakam/vendor/spirv_cross"
include "Mahakam/vendor/bullet/build3"
group ""
include "Mahakam"
if (not _OPTIONS["standalone"]) then
include "Erebor"
end
include "Sandbox"