-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinks.lua
95 lines (78 loc) · 1.65 KB
/
links.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
local thisDirectory = os.getcwd();
local LinkFuncs =
{
glload = function()
includedirs "glload/include"
libdirs "glload/lib"
configuration "Debug"
links {"glloadD"}
configuration "Release"
links {"glload"}
end,
glimage = function()
includedirs "glimg/include"
libdirs "glimg/lib"
configuration "Debug"
links {"glimgD"}
configuration "Release"
links {"glimg"}
end,
glutil = function()
includedirs "glutil/include"
libdirs "glutil/lib"
configuration "Debug"
links {"glutilD"}
configuration "Release"
links {"glutil"}
end,
glmesh = function()
includedirs "glmesh/include"
libdirs "glmesh/lib"
configuration "Debug"
links {"glmeshD"}
configuration "Release"
links {"glmesh"}
end,
glm = function()
includedirs "glm"
end,
freeglut = function()
includedirs "freeglut/include"
libdirs "freeglut/lib"
defines {"FREEGLUT_STATIC", "_LIB", "FREEGLUT_LIB_PRAGMAS=0"}
configuration "Debug"
links {"freeglutD"}
configuration "Release"
links {"freeglut"}
end,
glfw = function()
includedirs "glfw/include"
libdirs "glfw/library"
configuration "Debug"
links {"glfwD"}
configuration "Release"
links {"glfw"}
end,
}
local function ProcTable(tbl)
for i, lib in ipairs(tbl) do
if(type(lib) == "string") then
if(not LinkFuncs[lib]) then
print("Bad library named ", lib);
else
local prevDir = os.getcwd()
os.chdir(thisDirectory)
configuration {}
LinkFuncs[lib]()
configuration {}
os.chdir(prevDir)
end
elseif(type(lib) == "table") then
ProcTable(lib);
end
end
end
function UseLibs(...)
local libList = {...}
ProcTable(libList)
end