forked from skaslev/gl3w
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSConstruct
More file actions
26 lines (23 loc) · 775 Bytes
/
SConstruct
File metadata and controls
26 lines (23 loc) · 775 Bytes
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
import os, shutil, platform
env = Environment()
if env.GetOption('clean'):
for d in ['bin', 'include', 'lib']:
shutil.rmtree(d, True)
try: os.unlink('src/gl3w.c')
except: pass
else:
print 'Generating gl3w...'
execfile('gl3w_gen.py')
libs = []
if platform.system() == 'Darwin':
env.Append(CFLAGS=['-Wno-deprecated-declarations'],
FRAMEWORKS=['CoreFoundation', 'GLUT'])
else:
libs = ['glut', 'dl']
env.Append(CFLAGS=['-Wall', '-O2'])
env.Append(CPPPATH='include')
env.SharedLibrary('lib/gl3w', 'src/gl3w.c')
o = env.Object('src/test', 'src/test.c')
env.Program('bin/test_static', [o, 'src/gl3w.c'], LIBS=libs)
env.Program('bin/test_shared', o, LIBS=libs + ['gl3w'],
LIBPATH='lib', RPATH=os.path.abspath('lib'))