-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathSConstruct
More file actions
69 lines (49 loc) · 1.94 KB
/
SConstruct
File metadata and controls
69 lines (49 loc) · 1.94 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
import platform
from os.path import join, basename
from os import path
env = Environment(CC = 'g++')
os = env["PLATFORM"]
buildPath = "build"
env.Append(CPPPATH = ['include'])
env.Append(CCFLAGS = ['-g', '-pthread', '-O2', '-Wall'])
print "THIS IS THE OS: " + os
if os == "darwin":
env.Append(LINKFLAGS = ['-framework', 'OpenGL'])
env.Append(CPPPATH = ['/usr/local/Cellar/devil/1.7.8/include',
'/usr/local/Cellar/glew/1.9.0/include',
'/usr/local/Cellar/glfw/2.7.8/include'])
env.Append(LIBPATH = ['/usr/local/Cellar/devil/1.7.8/lib',
'/usr/local/Cellar/glew/1.9.0/lib',
'/usr/local/Cellar/glfw/2.7.8/lib'])
env.Append(LIBS = ['glfw','GLEW', 'IL', 'ILU', 'ILUT'])
else:
env.Append(LIBS = ['Xrandr', 'rt', 'X11', 'GLU', 'GL', 'GLEW', 'm', 'IL', 'ILU', 'ILUT'])
objects = []
sources = Glob("src/*.cpp")
programs = {
"quad":["test/quad.cpp"],
"matrix":["test/matrix.cpp"],
"interleaved":["test/interleaved.cpp"],
"strip":["test/strip.cpp"],
"texture":["test/texture.cpp"],
"vectorvbo":["test/vectorvbo.cpp"],
"ring":["test/ring.cpp"],
"loadmesh":["test/loadmesh.cpp"],
"envmap":["test/envmap.cpp"],
"fbotest":["test/fbotest.cpp"],
"vaotest":["test/vaotest.cpp"],
"camera":["test/camera.cpp"],
}
# Build all modules within the source directory
for file in sources:
fileName = basename(str(file))
fileName = fileName.split(".")[0]
outDir = join(buildPath, fileName)
objects += env.Object(outDir, file)
bits, linkage = platform.architecture()
if bits == '64bit':
archName = "x64"
else:
archName = "x32"
for name,srcList in programs.iteritems():
env.Program(join(buildPath, name), objects + srcList) #+ (srcList+['lib/%s/%s/libglfw.a' % (archName, os)]))