-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake4.lua
98 lines (84 loc) · 2.33 KB
/
premake4.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
#!lua
includeDirList = {
"shared",
"shared/gl3w",
"shared/imgui",
"shared/include"
}
buildOptions = {"-std=c++11"}
-- Get the current OS platform
PLATFORM = os.get()
-- Build glfw3 static library and copy it into <cs488_root>/lib if it is not
-- already present.
if not os.isfile("lib/libglfw3.a") then
os.chdir("shared/glfw-3.1.1")
os.mkdir("build")
os.chdir("build")
os.execute("cmake ../")
os.execute("make")
os.chdir("../../../")
os.mkdir("lib")
os.execute("cp shared/glfw-3.1.1/build/src/libglfw3.a lib/")
end
-- Build lua-5.3.1 library and copyt it into <cs488_root>/lib if it is not
-- already present.
if not os.isfile("lib/liblua.a") then
os.chdir("shared/lua-5.3.1")
if PLATFORM == "macosx" then
os.execute("make macosx")
elseif PLATFORM == "linux" then
os.execute("make linux")
elseif PLATFORM == "windows" then
os.execute("make mingw")
end
os.chdir("../../")
os.execute("cp shared/lua-5.3.1/src/liblua.a lib/")
end
solution "BuildStaticLibs"
configurations { "Debug", "Release" }
configuration "Debug"
defines { "DEBUG" }
flags { "Symbols" }
configuration "Release"
defines { "NDEBUG" }
flags { "Optimize" }
-- Builds cs488-framework static library
project "cs488-framework"
kind "StaticLib"
language "C++"
location "build"
objdir "build"
targetdir "lib"
buildoptions (buildOptions)
includedirs (includeDirList)
files { "shared/cs488-framework/*.cpp" }
-- Build imgui static library
project "imgui"
kind "StaticLib"
language "C++"
location "build"
objdir "build"
targetdir "lib"
includedirs (includeDirList)
includedirs {
"shared/imgui/examples/opengl3_example",
"shared/imgui/examples/libs/gl3w/",
}
files {
"shared/imgui/*.cpp",
"shared/gl3w/GL/gl3w.c"
}
-- Build lodepng static library
project "lodepng"
kind "StaticLib"
language "C++"
location "build"
objdir "build"
targetdir "lib"
includedirs (includeDirList)
includedirs {
"shared/lodepng"
}
files {
"shared/lodepng/lodepng.cpp"
}