diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-05-17 00:35:21 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-05-17 00:35:21 +0200 |
commit | 69ba0b04619ca6e32517b52c120241ff7762fce2 (patch) | |
tree | f758ca10d9ffcb51b9d9ef03515e29033656a0cd /SConstruct | |
parent | ed802f4fa92e3107b362b8d0daa6394ebdcd6d52 (diff) |
Fixed OS X support.
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 |