add q3data to the build. messed up prev commit

This commit is contained in:
Timothee 'TTimo' Besset 2012-10-07 13:37:16 -05:00
parent df729933f8
commit 4b1c195962
3 changed files with 21 additions and 35 deletions

View File

@ -11,38 +11,6 @@ Import( [ 'utils', 'config', 'settings', 'project', 'shlib_objects' ] )
libname = os.path.splitext( libname )[0] libname = os.path.splitext( libname )[0]
env = Environment() env = Environment()
# useJPEG = False
# useGtk = False
# useZ = False
# usePNG = False
# if ( libname == 'image' ):
# useJPEG = True
# if ( libname == 'surface' ):
# useGtk = True
# if ( libname == 'surface_ufoai' ):
# useGtk = True
# if ( libname == 'surface_quake2' ):
# useGtk = True
# if ( libname == 'surface_heretic2' ):
# useGtk = True
# if ( libname == 'bkgrnd2d' ):
# useGtk = True
# if ( libname == 'gtkgensurf' ):
# useGtk = True
# if ( libname == 'bobtoolz' ):
# useGtk = True
# if ( libname == 'camera' ):
# useGtk = True
# if ( libname == 'prtview' ):
# useGtk = True
# if ( libname == 'spritemodel' ):
# useGtk = True
# if ( libname == 'model' ):
# useGtk = True
# if ( libname == 'textool' ):
# useGtk = True
# if ( libname == 'imagepng' ):
# usePNG = True
useJPEG = True useJPEG = True
useGtk = True useGtk = True

View File

@ -13,7 +13,7 @@ import utils, urllib2, zipfile, shutil, pprint, subprocess, re
class Config: class Config:
# not used atm, but useful to keep a list in mind # not used atm, but useful to keep a list in mind
# may use them eventually for the 'all' and other aliases expansions? # may use them eventually for the 'all' and other aliases expansions?
target_choices = utils.Enum( 'radiant', 'q3map2', 'setup' ) target_choices = utils.Enum( 'radiant', 'q3map2', 'q3data', 'setup' )
config_choices = utils.Enum( 'debug', 'release' ) config_choices = utils.Enum( 'debug', 'release' )
# aliases # aliases
@ -22,7 +22,7 @@ class Config:
def __init__( self ): def __init__( self ):
# initialize defaults # initialize defaults
self.target_selected = [ 'radiant', 'q3map2' ] self.target_selected = [ 'radiant', 'q3map2', 'q3data', 'setup' ]
self.config_selected = [ 'release' ] self.config_selected = [ 'release' ]
# those are global to each config # those are global to each config
self.platform = platform.system() self.platform = platform.system()
@ -175,6 +175,22 @@ class Config:
q3map2 = SConscript( os.path.join( build_dir, sconscript_name ) ) q3map2 = SConscript( os.path.join( build_dir, sconscript_name ) )
Default( InstallAs( os.path.join( self.install_directory, compiler_name ), q3map2 ) ) Default( InstallAs( os.path.join( self.install_directory, compiler_name ), q3map2 ) )
def emit_q3data( self ):
settings = self
for config_name in self.config_selected:
config = {}
config['name'] = config_name
config['shared'] = False
Export( 'utils', 'settings', 'config' )
build_dir = os.path.join( 'build', config_name, 'q3data' )
VariantDir( build_dir, '.', duplicate = 0 )
lib_objects = []
for project in [ 'libs/mathlib/mathlib.vcproj', 'libs/l_net/l_net.vcproj', 'libs/ddslib/ddslib.vcproj' ]:
Export( 'project' )
lib_objects += SConscript( os.path.join( build_dir, 'SConscript.lib' ) )
Export( 'lib_objects' )
q3data = SConscript( os.path.join( build_dir, 'SConscript.q3data' ) )
Default( InstallAs( os.path.join( self.install_directory, 'q3data' ), q3data ) )
def emit( self ): def emit( self ):
if 'radiant' in self.target_selected: if 'radiant' in self.target_selected:
@ -182,6 +198,8 @@ class Config:
if 'q3map2' in self.target_selected: if 'q3map2' in self.target_selected:
self.emit_q3map2( urt = False ) self.emit_q3map2( urt = False )
self.emit_q3map2( urt = True ) self.emit_q3map2( urt = True )
if 'q3data' in self.target_selected:
self.emit_q3data()
if 'setup' in self.target_selected: if 'setup' in self.target_selected:
self.Setup() self.Setup()

View File

@ -75,7 +75,7 @@ def CheckUnresolved( source, target, env ):
return 1 return 1
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/413486 # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/413486
# OH_GOD, I used to think code like that was cool and useful
def Enum(*names): def Enum(*names):
##assert names, "Empty enums are not supported" # <- Don't like empty enums? Uncomment! ##assert names, "Empty enums are not supported" # <- Don't like empty enums? Uncomment!