-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake5.lua
163 lines (126 loc) · 3.75 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
-- premake5.lua
-- Setup the build configuration
build_directory = 'build'
outputdir="%{cfg.buildcfg}-%{cfg.system}"
editorintegration "On" -- Integrate with VS
editAndContinue "Off" -- Causes weird errors
workspace "Blazar"
architecture "x64"
configurations { "Debug", "Release", "Distribution" }
location (build_directory)
flags { 'MultiProcessorCompile' }
filter "system:windows"
defines("_ITERATOR_DEBUG_LEVEL=0") -- Prevent excessive stl container stuff
output_dir="%{cfg.buildcfg}-%{cfg.system}"
IncludeDir= {}
library_includes={}
library_links={}
include "src/Vendor/vendor.lua"
project "Blazar"
location "build/Blazar/"
kind "StaticLib"
language "C++"
cppdialect "C++17"
targetdir ("build/bin/" .. outputdir .. "/%{prj.name}")
objdir("build/Intermediate/" .. outputdir .. "/%{prj.name}")
pchheader "bzpch.h"
pchsource "src/Blazar/bzpch.cpp"
links(library_links)
includedirs("src/%{prj.name}/")
includedirs(library_includes)
files
{
"src/%{prj.name}/**.h",
"src/%{prj.name}/**.cpp",
"build/reflection_types.cpp"
}
filter "configurations:Debug"
symbols "On"
runtime "Debug"
defines ({"BLAZAR_DEBUG"})
defines("TRACY_ENABLE")
filter "configurations:Release"
defines ({"BLAZAR_RELEASE"})
optimize "On"
runtime "Release"
defines("TRACY_ENABLE")
filter "configurations:Distrobution"
defines ({"BLAZAR_DIST", "BLAZAR_RELEASE"})
optimize "Full"
runtime "Release"
filter "system:windows"
staticruntime "Off"
systemversion "latest"
defines
{
"BLAZAR_PLATFORM_WINDOWS",
"BLAZAR_BUILD_STATIC",
"GLFW_INCLUDE_NONE",
}
disablewarnings({"26812", "26495", "26451", "26498", "6201", "6285", "26437"})
filter "system:linux"
defines
{
"BLAZAR_PLATFORM_LINUX",
"BLAZAR_BUILD_STATIC",
"GLFW_INCLUDE_NONE"
}
links { "dl", "pthread" }
defines { "_X11" }
project "Game"
location "build/Game"
kind "WindowedApp"
language "C++"
cppdialect "C++17"
targetdir ("build/bin/" .. outputdir .. "/%{prj.name}")
objdir("build/Intermediate/" .. outputdir .. "/%{prj.name}")
debugdir("build/bin/" .. outputdir .. "/%{prj.name}")
files
{
"src/%{prj.name}/**.h",
"src/%{prj.name}/**.cpp",
}
includedirs
{
"src/%{prj.name}/",
"src/Blazar/"
}
includedirs(library_includes)
links(library_links)
links("Blazar")
filter "configurations:Debug"
defines ({"BLAZAR_DEBUG", "BLAZAR_CONSOLE_WINDOW"})
symbols "On"
runtime "Debug"
kind "ConsoleApp"
defines("TRACY_ENABLE")
filter "configurations:Release"
defines "BLAZAR_RELEASE"
optimize "On"
runtime "Release"
defines("TRACY_ENABLE")
filter "configurations:Distrobution"
defines ({"BLAZAR_DIST", "BLAZAR_RELEASE"})
optimize "Full"
runtime "Release"
filter "system:windows"
systemversion "latest"
defines
{
"BLAZAR_PLATFORM_WINDOWS",
"BLAZAR_BUILD_STATIC"
}
postbuildcommands {
'xcopy "%{wks.location}..\\assets" "..\\bin\\%{outputdir}\\%{prj.name}\\Contents\\" /Q /E /Y /I'
}
filter "system:linux"
defines
{
"BLAZAR_PLATFORM_LINUX",
"BLAZAR_BUILD_STATIC"
}
links { "dl", "pthread", "GL", "X11", "GLAD"}
defines { "_X11" }
postbuildcommands {
"cp -r %{wks.location}/../assets ../bin/%{outputdir}/%{prj.name}/Contents/"
}