compile both versions of q3map2

This commit is contained in:
Timothee 'TTimo' Besset 2012-06-09 13:49:40 -05:00
parent 61a03e2ee7
commit 8212783597

View file

@ -150,14 +150,20 @@ class Config:
module = SConscript( os.path.join( build_dir, 'SConscript.module' ) ) module = SConscript( os.path.join( build_dir, 'SConscript.module' ) )
Default( InstallAs( os.path.join( self.install_directory, 'modules/%s.so' % libname ), module ) ) Default( InstallAs( os.path.join( self.install_directory, 'modules/%s.so' % libname ), module ) )
def emit_q3map2( self ): def emit_q3map2( self, urt = False ):
if ( urt ):
compiler_name = 'q3map2.urt'
sconscript_name = 'SConscript.q3map2.urt'
else:
compiler_name = 'q3map2'
sconscript_name = 'SConscript.q3map2'
settings = self settings = self
for config_name in self.config_selected: for config_name in self.config_selected:
config = {} config = {}
config['name'] = config_name config['name'] = config_name
config['shared'] = False config['shared'] = False
Export( 'utils', 'settings', 'config' ) Export( 'utils', 'settings', 'config' )
build_dir = os.path.join( 'build', config_name, 'q3map2' ) build_dir = os.path.join( 'build', config_name, compiler_name )
VariantDir( build_dir, '.', duplicate = 0 ) VariantDir( build_dir, '.', duplicate = 0 )
lib_objects = [] lib_objects = []
for project in [ 'tools/quake3/common/quake3-common.vcproj', 'libs/mathlib/mathlib.vcproj', 'libs/l_net/l_net.vcproj', 'libs/ddslib/ddslib.vcproj', 'libs/picomodel/picomodel.vcproj', 'libs/md5lib/md5lib.vcproj' ]: for project in [ 'tools/quake3/common/quake3-common.vcproj', 'libs/mathlib/mathlib.vcproj', 'libs/l_net/l_net.vcproj', 'libs/ddslib/ddslib.vcproj', 'libs/picomodel/picomodel.vcproj', 'libs/md5lib/md5lib.vcproj' ]:
@ -165,33 +171,18 @@ class Config:
lib_objects += SConscript( os.path.join( build_dir, 'SConscript.lib' ) ) lib_objects += SConscript( os.path.join( build_dir, 'SConscript.lib' ) )
Export( 'lib_objects' ) Export( 'lib_objects' )
# q3map2 = SConscript( os.path.join( build_dir, 'SConscript.q3map2' ) ) q3map2 = SConscript( os.path.join( build_dir, sconscript_name ) )
# Default( InstallAs( os.path.join( self.install_directory, 'q3map2' ), q3map2 ) ) Default( InstallAs( os.path.join( self.install_directory, compiler_name ), q3map2 ) )
q3map2_urt = SConscript( os.path.join( build_dir, 'SConscript.q3map2.urt' ) )
Default( InstallAs( os.path.join( self.install_directory, 'q3map2.urt' ), q3map2_urt ) )
def emit( self ): def emit( self ):
try: if 'radiant' in self.target_selected:
self.target_selected.index( 'radiant' ) self.emit_radiant()
except: if 'q3map2' in self.target_selected:
pass self.emit_q3map2( urt = False )
else: self.emit_q3map2( urt = True )
self.emit_radiant() if 'setup' in self.target_selected:
try: self.Setup()
self.target_selected.index( 'q3map2' )
except:
pass
else:
self.emit_q3map2()
try:
self.target_selected.index( 'setup' )
except:
pass
else:
self.Setup()
def SetupEnvironment( self, env, config, useGtk = False, useGtkGL = False, useJPEG = False, useZ = False, usePNG = False ): def SetupEnvironment( self, env, config, useGtk = False, useGtkGL = False, useJPEG = False, useZ = False, usePNG = False ):
env['CC'] = self.cc env['CC'] = self.cc