diff options
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 32 |
1 files changed, 17 insertions, 15 deletions
@@ -1,22 +1,24 @@ -AddOption('--release', action = 'store_true') +import os -env = Environment() +env = Environment( + ENV = os.environ, +) -conf = Configure(env) -for lib in ('GL', 'GLU', 'SDL', 'SDL_image'): - if not conf.CheckLib(lib): - print 'Could not find %s' % lib - Exit(1) -env = conf.Finish() +common_sources = [] -if GetOption('release'): - env.Append(CCFLAGS = ['-O2']) +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']) + common_sources.append('SDLMain.m') else: - env.Append(CCFLAGS = ['-Wall', '-g']) + env.Append(LIBS = ['GL', 'GLU', 'SDL', 'SDL_image']) + env.ParseConfig('sdl-config --cflags --libs') + env.ParseConfig('pkg-config --cflags --libs ftgl') -env.ParseConfig('sdl-config --cflags --libs') -env.ParseConfig('pkg-config --cflags --libs ftgl') - -env.Program('foo', Glob('*.cpp')) +env.Program('foo', common_sources + Glob('*.cpp')) # vim: syn=python |