summaryrefslogtreecommitdiff
path: root/SConstruct
blob: 1a4901781a74c63470d61c231b3f01c6bb6f78f8 (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
import os

env = Environment(
	ENV = os.environ,
)

engine = Glob('engine/*.cpp')

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

if env['PLATFORM'] == 'darwin':
	env.Append(CPPFLAGS = '')
	env.Append(LINKFLAGS = '')
	env.Append(CPPPATH = ['/opt/local/include', '/opt/local/include/freetype2'])
	env.Append(LIBS = ['ftgl'])
	env.Append(LIBPATH = ['/opt/local/lib'])
	env.Append(FRAMEWORKS = ['SDL', 'SDL_image', 'Cocoa', 'OpenGL', 'AppKit'])
	engine.append('engine/SDLMain.m')
else:
	env.Append(LIBS = ['GL', 'GLU', 'SDL', 'SDL_image'])
	env.ParseConfig('sdl-config --cflags --libs')
	env.ParseConfig('pkg-config --cflags --libs ftgl')

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

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

env.Program('foo', ['main.cpp'] + engine)

# vim: syn=python