-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathtemplate.lua
155 lines (130 loc) · 2.71 KB
/
template.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
projName = "ProjectName"
angeDir = "<Path\\To\\ANGE>"
workspace "Solution"
startproject (projName)
configurations
{
"Debug",
"Release",
}
--Add options
newoption {
trigger = "arch",
value = "VALUE",
description = "Choose a particular CPU architecture",
allowed = {
{ "x86", "32 bit architecture" },
{ "x64", "64 bit architecture" }
}
}
newoption {
trigger = "compiler",
value = "VALUE",
description = "Choose a particular compiler to use in build",
allowed = {
{ "clang", "Clang (clang)" },
{ "gcc", "GNU GCC (gcc/g++)" },
{ "msc", "Microsoft Visual C++ Compiler" }
}
}
print("----------------------------")
-- Architecture
if not _OPTIONS["arch"] then
_OPTIONS["arch"] = "x64"
end
architecture (_OPTIONS["arch"])
-- Print message
if _OPTIONS["arch"] == "x64" then
print("Choosen architecture - x64");
elseif _OPTIONS["arch"] == "x86" then
print("Choosen architecture - x86");
end
-- Toolset
if not _OPTIONS["compiler"] then
_OPTIONS["compiler"] = "clang"
end
toolset (_OPTIONS["compiler"])
-- Print message & Fix GCC
if _OPTIONS["compiler"] == "gcc" then
print("Configuring for - GCC")
makesettings [[
CC = gcc
]]
elseif _OPTIONS["compiler"] == "clang" then
print("Configuring for - CLANG")
elseif _OPTIONS["compiler"] == "msc" then
print("Configuring for - MSVC")
end
print("----------------------------")
outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"
project (projName)
architecture "x64"
location (projName)
kind "ConsoleApp"
language "C++"
cppdialect "C++17"
staticruntime "on"
linkgroups "on"
targetdir (projName .. "/Build/" .. outputdir .. "/%{prj.name}")
objdir (projName .. "/Build-obj/" .. outputdir .. "/%{prj.name}")
files
{
"%{prj.name}/**.h",
"%{prj.name}/**.cpp"
}
includedirs
{
angeDir .. "\\include",
angeDir .. "\\include\\**",
}
libdirs
{
angeDir .. "\\lib",
}
filter "system:windows"
systemversion "latest"
defines
{
"ANGE_PLATFORM_WINDOWS",
}
links
{
"opengl32",
"Ange",
"GLFW",
"libpng",
"libjpeg",
"zlib",
"FreeType",
"glad"
}
filter "system:linux"
defines
{
"ANGE_PLATFORM_LINUX",
}
links
{
"AngePacked",
"pthread",
"GLU",
"GL",
"rt",
"Xrandr",
"Xxf86vm",
"Xi",
"Xinerama",
"X11",
"dl",
"Xcursor",
"libjpeg",
"FreeType",
}
filter "configurations:Debug"
defines "ANGE_DEBUG"
runtime "Debug"
symbols "on"
filter "configurations:Release"
defines "ANGE_RELEASE"
runtime "Release"
optimize "on"