Clean up of SCons in preparation to move to CMake (#1)

This commit is contained in:
Radegast 2013-03-25 17:22:39 +01:00
parent f75ae23357
commit 5b40e7d73b
1 changed files with 9 additions and 21 deletions

View File

@ -6,16 +6,9 @@ if __name__ != '__main__':
import utils, urllib2, zipfile, shutil, pprint, subprocess, re, os.path import utils, urllib2, zipfile, shutil, pprint, subprocess, re, os.path
# config = debug release # config = debug release
# aliases are going to be very needed here
# we have dependency situations too
# target = # target =
class Config: class Config:
# not used atm, but useful to keep a list in mind
# may use them eventually for the 'all' and other aliases expansions?
target_choices = utils.Enum( 'radiant', 'q3map2', 'q3data', 'setup' )
config_choices = utils.Enum( 'debug', 'release' )
# aliases # aliases
# 'all' -> for each choices # 'all' -> for each choices
# 'gamecode' for the targets, 'game' 'cgame' 'ui' # 'gamecode' for the targets, 'game' 'cgame' 'ui'
@ -32,8 +25,8 @@ class Config:
# platforms for which to assemble a setup # platforms for which to assemble a setup
self.setup_platforms = [ 'local', 'x86', 'x64', 'win32' ] self.setup_platforms = [ 'local', 'x86', 'x64', 'win32' ]
# paks to assemble in the setup # paks to assemble in the setup (only the Enemy Territory one by default)
self.setup_packs = [ 'Q3Pack', 'UrTPack', 'ETPack', 'QLPack' ] self.setup_packs = [ 'ETPack' ] # [ 'Q3Pack', 'UrTPack', 'ETPack', 'QLPack' ]
def __repr__( self ): def __repr__( self ):
return 'config: target=%s config=%s' % ( self.target_selected, self.config_selected ) return 'config: target=%s config=%s' % ( self.target_selected, self.config_selected )
@ -219,29 +212,24 @@ class Config:
env.Append( LINKFLAGS = xml2libs.split( ' ' ) ) env.Append( LINKFLAGS = xml2libs.split( ' ' ) )
baseflags = [ '-pipe', '-Wall', '-fmessage-length=0', '-fvisibility=hidden', xml2.split( ' ' ) ] baseflags = [ '-pipe', '-Wall', '-fmessage-length=0', '-fvisibility=hidden', xml2.split( ' ' ) ]
if ( self.platform == 'Darwin' ):
if ( os.path.isdir( '/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include' ) ):
env.Append( CPPPATH = [ '/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include' ] )
else:
env.ParseConfig( 'pkg-config x11 --cflags' )
env.ParseConfig( 'pkg-config glu --cflags --libs' )
env.ParseConfig( 'pkg-config zlib --cflags --libs' )
if ( useGtk ): if ( useGtk ):
env.ParseConfig( 'pkg-config gtk+-2.0 --cflags --libs' ) env.ParseConfig( 'pkg-config gtk+-2.0 --cflags --libs' )
env.ParseConfig( 'pkg-config x11 --cflags --libs' )
else: else:
# always setup at least glib # always setup at least glib
env.ParseConfig( 'pkg-config glib-2.0 --cflags --libs' ) env.ParseConfig( 'pkg-config glib-2.0 --cflags --libs' )
if ( useGtkGL ): if ( useGtkGL ):
env.ParseConfig( 'pkg-config glu --cflags --libs' )
env.ParseConfig( 'pkg-config gtkglext-1.0 --cflags --libs' ) env.ParseConfig( 'pkg-config gtkglext-1.0 --cflags --libs' )
if ( useJPEG ): if ( useJPEG ):
env.Append( LIBS = 'jpeg' ) env.Append( LIBS = 'jpeg' )
if ( usePNG ): if ( usePNG ):
pnglibs = 'png z' pnglibs = 'png'
env.Append( LIBS = pnglibs.split( ' ' ) ) env.Append( LIBS = pnglibs.split( ' ' ) )
if ( useZ ): env.ParseConfig( 'pkg-config zlib --cflags --libs' )
env.Append( LIBS = 'z' ) if ( useZ ):
env.ParseConfig( 'pkg-config zlib --cflags --libs' )
env.Append( CCFLAGS = baseflags ) env.Append( CCFLAGS = baseflags )
env.Append( CXXFLAGS = baseflags + [ '-fpermissive', '-fvisibility-inlines-hidden' ] ) env.Append( CXXFLAGS = baseflags + [ '-fpermissive', '-fvisibility-inlines-hidden' ] )