Repository navigation
Expand file tree
/
Copy pathpremake5.lua
More file actions
172 lines (142 loc) · 4.52 KB
/
Copy pathpremake5.lua
File metadata and controls
172 lines (142 loc) · 4.52 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
-- ref: https://github.com/premake/premake-core/wiki/Your-First-Script
workspace "Eye"
architecture "x86_64"
startproject "GameSandbox"
configurations
{
"Debug",
"Release", -- fast version of Debug mode
"Dist" -- distribution mode
}
flags
{
"MultiProcessorCompile"
}
-- tokens ref: https://github.com/premake/premake-core/wiki/Tokens
outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"
-- vendor include directories structure which relative to solution root folder
IncludeDir = {}
IncludeDir["GLFW"] = "Eye/vendor/GLFW/include"
IncludeDir["Glad"] = "Eye/vendor/Glad/include"
IncludeDir["ImGui"] = "Eye/vendor/imgui"
IncludeDir["glm"] = "Eye/vendor/glm"
IncludeDir["stb_image"] = "Eye/vendor/stb_image"
-- include `premake5.lua` of vendors
group "Dependencies"
include "Eye/vendor/GLFW"
include "Eye/vendor/Glad"
include "Eye/vendor/imgui"
group ""
project "Eye"
location "Eye"
-- kind "SharedLib" -- dynamic library (DLL)
kind "StaticLib" -- static library
language "C++"
cppdialect "C++17"
staticruntime "On"
targetdir ("bin/" .. outputdir .. "/%{prj.name}") -- target directory
objdir ("bin-int/" .. outputdir .. "/%{prj.name}") -- intermediate directory
pchheader "eyepch.h"
pchsource "Eye/src/eyepch.cpp"
files -- project files
{
"%{prj.name}/src/**.h",
"%{prj.name}/src/**.cpp",
"%{prj.name}/vendor/stb_image/**.h",
"%{prj.name}/vendor/stb_image/**.cpp",
"%{prj.name}/vendor/glm/glm/**.hpp",
"%{prj.name}/vendor/glm/glm/**.inl"
}
defines
{
"_CRT_SECURE_NO_WARNINGS"
}
includedirs -- addtional include directories
{
"%{prj.name}/src",
"%{prj.name}/vendor/spdlog/include",
"%{IncludeDir.GLFW}",
"%{IncludeDir.Glad}",
"%{IncludeDir.ImGui}",
"%{IncludeDir.glm}",
"%{IncludeDir.stb_image}"
}
links
{
"GLFW",
"Glad",
"ImGui",
"opengl32.lib"
}
-- ref: https://github.com/premake/premake-core/wiki/filter
filter "system:windows" -- filter for Windows platform
-- staticruntime "On"
systemversion "latest" -- windows SDK version
-- ref: https://github.com/premake/premake-core/wiki/defines
defines -- preprocessor definitions
{
"EYE_BUILD_DLL",
"GLFW_INCLUDE_NONE"
}
-- ref: https://github.com/premake/premake-core/wiki/postbuildcommands
-- postbuildcommands
-- {
-- ("{COPY} %{cfg.buildtarget.relpath} \"../bin/" .. outputdir .. "/GameSandbox\"") -- copy Eye Engine dll to GameSandbox bin dir
-- }
filter "configurations:Debug" -- filter for Debug mode
defines "EYE_DEBUG"
-- buildoptions "/MDd"
runtime "Debug"
symbols "On"
filter "configurations:Release" -- filter for Release mode
defines "EYE_RELEASE"
-- buildoptions "/MD"
runtime "Release"
optimize "On"
filter "configurations:Dist" -- filter for Distribution mode
defines "EYE_DIST"
-- buildoptions "/MD"
runtime "Release"
optimize "On"
project "GameSandbox"
location "GameSandbox"
kind "ConsoleApp" -- exe
language "C++"
cppdialect "C++17"
staticruntime "On"
targetdir ("bin/" .. outputdir .. "/%{prj.name}") -- target directory
objdir ("bin-int/" .. outputdir .. "/%{prj.name}") -- intermediate directory
files -- project files
{
"%{prj.name}/src/**.h",
"%{prj.name}/src/**.cpp",
}
includedirs -- addtional include directories
{
"Eye/vendor/spdlog/include",
"Eye/vendor",
"Eye/src",
"%{IncludeDir.glm}"
}
links
{
"Eye" -- reference to project "Eye"
}
-- ref: https://github.com/premake/premake-core/wiki/filter
filter "system:windows" -- filter for Windows platform
systemversion "latest" -- windows SDK version (set spec version or use "latest")
filter "configurations:Debug" -- filter for Debug mode
defines "EYE_DEBUG"
-- buildoptions "/MDd"
runtime "Debug"
symbols "On"
filter "configurations:Release" -- filter for Release mode
defines "EYE_RELEASE"
-- buildoptions "/MD"
runtime "Release"
optimize "On"
filter "configurations:Dist" -- filter for Distribution mode
defines "EYE_DIST"
-- buildoptions "/MD"
runtime "Release"
optimize "On"