-
Notifications
You must be signed in to change notification settings - Fork 1
/
SConstruct
50 lines (42 loc) · 1.6 KB
/
SConstruct
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
#!/usr/bin/env python
import os.path
from glob import glob
prog_target = 'tx'
sources = glob('src/*.cpp')
env = Environment()
win32 = ARGUMENTS.get('win32', 0)
debug_flag = ARGUMENTS.get('debug', 0)
#env.Tool('colourful', toolpath=['scons-tools'])
env.AppendUnique(LIBS=['m', 'IL', 'mxml', 'rcbc', 'luabind'])
env.Tool('qt')
if int(win32):
env.Tool('crossmingw', toolpath = ['scons-tools'])
env['MINGWROOT'] = '/usr/$MINGWPREFIX'
env['MINGWLIBS'] = '$MINGWROOT/lib'
env['MINGWINC'] = '$MINGWROOT/include'
env.AppendUnique(LIBS=['opengl32', 'glu32'])
env.ParseConfig('/usr/$MINGWPREFIX/bin/sdl-config --cflags --libs')
env.AppendUnique(LIBS=['lua'])
env.AppendUnique(LIBS=['bulletdynamics', 'bulletcollision', 'bulletmath'])
env.MergeFlags(env.subst('-I$MINGWINC/bullet/'))
env.MergeFlags(env.subst("$MINGWLIBS/libopengl32.a"))
env.MergeFlags(env.subst("$MINGWLIBS/libmxml.a"))
env.MergeFlags(env.subst("$MINGWLIBS/DevIL.lib"))
env['QTDIR'] = '$MINGWROOT'
env['QT_LIB'] = 'QtGui4'
env.MergeFlags(env.subst("-DQT_SHARED -I$MINGWINC/qt4 -I$MINGWINC/qt4/QtGui -I$MINGWINC/qt4/QtCore -lQtGui4 -lQtCore4"))
else:
env.AppendUnique(LIBS=['GL', 'GLU'])
env.ParseConfig('sdl-config --cflags --libs')
env.ParseConfig('pkg-config --cflags --libs lua5.1')
env.ParseConfig('pkg-config --cflags --libs bullet')
env['QTDIR'] = '/usr'
env['QT_LIB'] = 'QtGui'
env.ParseConfig('pkg-config --libs --cflags QtGui')
if int(debug_flag):
env.Append(CCFLAGS = ['-g'])
env.MergeFlags('-D_DEBUG')
env.Append(CCFLAGS = ['-Wall'])
objects = env.Object(sources)
target = env.Program(target = prog_target, source=objects)
Default(target)