summaryrefslogtreecommitdiff
path: root/SConstruct
blob: eabcf028bd7eae22831275659fea811831207b7e (plain)
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
import os

env = Environment(
	ENV = os.environ,
)

AddOption('--release', action = 'store_true')
AddOption('--profiling', action = 'store_true')
AddOption('--mingw32', action = 'store_true')

env.Append(CPPPATH = ['.', 'common'])

# cross-compiling
if GetOption('mingw32'):
	env.Append(CPPPATH = ['/usr/i486-mingw32/include/' + x for x in ('SDL', 'CEGUI', 'freetype2')])
	env.Append(LIBS = ['CEGUIOpenGLRenderer', 'CEGUIBase', 'CEGUITGAImageCodec', 'CEGUITinyXMLParser', 'CEGUIFalagardWRBase', 'CEGUISILLYImageCodec',
		'SDL_image', 'ftgl', 'freetype-s', 'z', 'pcre', 'opengl32', 'glu32', 'winmm', 'wsock32', 'ws2_32', 'mingw32', 'SDLmain', 'SDL', 'jpeg', 'noise',
		'lua', 'tolua++_Static', 'boost_filesystem-mt-s', 'boost_system-mt-s'])
	env.Append(CPPFLAGS = ['-D_WIN32_WINNT=0x0501'])
	env.Append(LINKFLAGS = ['-static-libgcc', '-static-libstdc++'])
	env['CXX'] = 'i486-mingw32-g++'
else:
	env.Append(LIBS = ['GL', 'GLU', 'noise', 'boost_filesystem', 'tolua++', 'lua'])
	env.ParseConfig('sdl-config --cflags --libs')
	env.ParseConfig('pkg-config --cflags --libs SDL_image')
	env.ParseConfig('pkg-config --cflags --libs ftgl')
	env.ParseConfig('pkg-config --cflags --libs CEGUI')
	env.ParseConfig('pkg-config --cflags --libs CEGUI-OPENGL')
	env.ParseConfig('pkg-config --cflags --libs assimp')

if not GetOption('release'):
	env.Append(CPPFLAGS = ['-Wall', '-g'])

if GetOption('profiling'):
	env.Append(CPPFLAGS = ['-pg'])
	env.Append(LINKFLAGS = ['-pg'])

Export('env')

env.SConscript('scripting/SConscript')

env.Program('gress.exe' if GetOption('mingw32') else 'gress', Glob('*.cpp') + Glob('widgets/*.cpp') + Glob('scripting/*.cpp') + Glob('common/*.cpp'))

# vim: syn=python