mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2024-12-04 01:51:16 +00:00
read source file lists from .vcxproj files for SCons build
This commit is contained in:
parent
d66c0b02a7
commit
76a9631a1a
9 changed files with 40 additions and 39 deletions
|
@ -12,7 +12,7 @@ libname = os.path.splitext( libname )[0]
|
|||
|
||||
env = Environment( ENV = os.environ )
|
||||
settings.SetupEnvironment( env, config['name'] )
|
||||
proj = utils.vcproj( os.path.join( GetLaunchDir(), project ) )
|
||||
proj = utils.vcxproj( os.path.join( GetLaunchDir(), project ) )
|
||||
|
||||
# some filtering. may need to improve that
|
||||
add_sources = []
|
||||
|
|
|
@ -18,7 +18,7 @@ useZ = True
|
|||
usePNG = True
|
||||
|
||||
settings.SetupEnvironment( env, config['name'], useGtk = useGtk, useJPEG = useJPEG, useZ = useZ, usePNG = usePNG )
|
||||
proj = utils.vcproj( os.path.join( GetLaunchDir(), project ) )
|
||||
proj = utils.vcxproj( os.path.join( GetLaunchDir(), project ) )
|
||||
|
||||
# some filtering. may need to improve that
|
||||
add_sources = []
|
||||
|
|
|
@ -11,7 +11,7 @@ env = Environment( ENV = os.environ )
|
|||
settings.SetupEnvironment( env, config['name'] )
|
||||
env.Prepend( CPPPATH = [ '#tools/quake3/common' ] )
|
||||
env.Append( LIBS = [ 'm', 'pthread' ] )
|
||||
proj = utils.vcproj( os.path.join( GetLaunchDir(), 'tools/quake3/q3data/q3data.vcproj' ) )
|
||||
proj = utils.vcxproj( os.path.join( GetLaunchDir(), 'tools/quake3/q3data/q3data.vcxproj' ) )
|
||||
objects = lib_objects
|
||||
objects += [ os.path.join( 'tools/quake3/q3data', i ) for i in proj.getSourceFiles() ]
|
||||
q3data = env.Program( 'q3data', objects )
|
||||
|
|
|
@ -11,7 +11,7 @@ env = Environment( ENV = os.environ )
|
|||
settings.SetupEnvironment( env, config['name'] )
|
||||
env.Prepend( CPPPATH = [ '#tools/quake3/common' ] )
|
||||
env.Append( LIBS = [ 'm', 'pthread', 'png', 'jpeg' ] )
|
||||
proj = utils.vcproj( os.path.join( GetLaunchDir(), 'tools/quake3/q3map2/q3map2.vcproj' ) )
|
||||
proj = utils.vcxproj( os.path.join( GetLaunchDir(), 'tools/quake3/q3map2/q3map2.vcxproj' ) )
|
||||
objects = lib_objects
|
||||
objects += [ os.path.join( 'tools/quake3/q3map2', i ) for i in proj.getSourceFiles() ]
|
||||
q3map2 = env.Program( 'q3map2', objects )
|
||||
|
|
|
@ -11,7 +11,7 @@ env = Environment( ENV = os.environ )
|
|||
settings.SetupEnvironment( env, config['name'] )
|
||||
env.Prepend( CPPPATH = [ '#tools/quake3/common', ] )
|
||||
env.Append( LIBS = [ 'm', 'pthread', 'png', 'jpeg' ] )
|
||||
proj = utils.vcproj( os.path.join( GetLaunchDir(), 'tools/urt/tools/quake3/q3map2/q3map2_urt.vcproj' ) )
|
||||
proj = utils.vcxproj( os.path.join( GetLaunchDir(), 'tools/urt/tools/quake3/q3map2/q3map2_urt.vcxproj' ) )
|
||||
objects = lib_objects
|
||||
|
||||
def keep_file( n ):
|
||||
|
|
|
@ -10,7 +10,7 @@ Import( [ 'utils', 'config', 'settings', 'lib_objects' ] )
|
|||
env = Environment( ENV = os.environ )
|
||||
settings.SetupEnvironment( env, config[ 'name' ], useGtk = True, useGtkGL = True )
|
||||
env.Append( LIBS = [ 'dl' ] )
|
||||
proj = utils.vcproj( os.path.join( GetLaunchDir(), 'radiant/radiant.vcproj' ) )
|
||||
proj = utils.vcxproj( os.path.join( GetLaunchDir(), 'radiant/radiant.vcxproj' ) )
|
||||
|
||||
radiant = env.Program( 'radiant.bin', lib_objects + [ os.path.join( 'radiant', i ) for i in proj.getSourceFiles() ] )
|
||||
|
||||
|
|
2
bspc
2
bspc
|
@ -1 +1 @@
|
|||
Subproject commit a1287590f17c35a612f33708aeec5815402866b8
|
||||
Subproject commit 2c8407838398608cb9c52abae046987bb7a39c08
|
58
config.py
58
config.py
|
@ -72,7 +72,7 @@ class Config:
|
|||
build_dir = os.path.join( 'build', config_name, 'radiant' )
|
||||
VariantDir( build_dir, '.', duplicate = 0 )
|
||||
lib_objects = []
|
||||
for project in [ 'libs/synapse/synapse.vcproj', 'libs/cmdlib/cmdlib.vcproj', 'libs/mathlib/mathlib.vcproj', 'libs/l_net/l_net.vcproj' ]:
|
||||
for project in [ 'libs/synapse/synapse.vcxproj', 'libs/cmdlib/cmdlib.vcxproj', 'libs/mathlib/mathlib.vcxproj', 'libs/l_net/l_net.vcxproj' ]:
|
||||
Export( 'project' )
|
||||
lib_objects += SConscript( os.path.join( build_dir, 'SConscript.lib' ) )
|
||||
Export( 'lib_objects' )
|
||||
|
@ -81,7 +81,7 @@ class Config:
|
|||
|
||||
# PIC versions of the libs for the modules
|
||||
shlib_objects_extra = {}
|
||||
for project in [ 'libs/synapse/synapse.vcproj', 'libs/mathlib/mathlib.vcproj', 'libs/picomodel/picomodel.vcproj', 'libs/cmdlib/cmdlib.vcproj', 'libs/splines/splines.vcproj' ]:
|
||||
for project in [ 'libs/synapse/synapse.vcxproj', 'libs/mathlib/mathlib.vcxproj', 'libs/picomodel/picomodel.vcxproj', 'libs/cmdlib/cmdlib.vcxproj', 'libs/splines/splines.vcxproj' ]:
|
||||
( libpath, libname ) = os.path.split( project )
|
||||
libname = os.path.splitext( libname )[0]
|
||||
config['shared'] = True
|
||||
|
@ -90,31 +90,31 @@ class Config:
|
|||
VariantDir( build_dir, '.', duplicate = 0 )
|
||||
shlib_objects_extra[libname] = SConscript( os.path.join( build_dir, 'SConscript.lib' ) )
|
||||
|
||||
for project in [ 'plugins/vfsqlpk3/vfsqlpk3.vcproj',
|
||||
'plugins/vfspk3/vfspk3.vcproj',
|
||||
'plugins/vfspak/vfspak.vcproj',
|
||||
'plugins/vfswad/vfswad.vcproj',
|
||||
'plugins/eclassfgd/fgd.vcproj',
|
||||
'plugins/entity/entity.vcproj',
|
||||
'plugins/image/image.vcproj',
|
||||
'plugins/model/model.vcproj',
|
||||
'plugins/imagepng/imagepng.vcproj',
|
||||
'plugins/imagewal/imagewal.vcproj',
|
||||
'plugins/imagehl/imagehl.vcproj',
|
||||
'plugins/imagem8/imagem8.vcproj',
|
||||
'plugins/spritemodel/spritemodel.vcproj',
|
||||
'plugins/textool/textool.vcproj',
|
||||
'plugins/map/map.vcproj',
|
||||
'plugins/mapxml/mapxml.vcproj',
|
||||
'plugins/shaders/shaders.vcproj',
|
||||
'plugins/surface/surface.vcproj',
|
||||
'plugins/surface_idtech2/surface_idtech2.vcproj',
|
||||
'contrib/camera/camera.vcproj',
|
||||
'contrib/prtview/prtview.vcproj',
|
||||
'contrib/hydratoolz/hydratoolz.vcproj',
|
||||
'contrib/bobtoolz/bobtoolz.vcproj',
|
||||
'contrib/gtkgensurf/gtkgensurf.vcproj',
|
||||
'contrib/bkgrnd2d/bkgrnd2d.vcproj'
|
||||
for project in [ 'plugins/vfsqlpk3/vfsqlpk3.vcxproj',
|
||||
'plugins/vfspk3/vfspk3.vcxproj',
|
||||
'plugins/vfspak/vfspak.vcxproj',
|
||||
'plugins/vfswad/vfswad.vcxproj',
|
||||
'plugins/eclassfgd/fgd.vcxproj',
|
||||
'plugins/entity/entity.vcxproj',
|
||||
'plugins/image/image.vcxproj',
|
||||
'plugins/model/model.vcxproj',
|
||||
'plugins/imagepng/imagepng.vcxproj',
|
||||
'plugins/imagewal/imagewal.vcxproj',
|
||||
'plugins/imagehl/imagehl.vcxproj',
|
||||
'plugins/imagem8/imagem8.vcxproj',
|
||||
'plugins/spritemodel/spritemodel.vcxproj',
|
||||
'plugins/textool/textool.vcxproj',
|
||||
'plugins/map/map.vcxproj',
|
||||
'plugins/mapxml/mapxml.vcxproj',
|
||||
'plugins/shaders/shaders.vcxproj',
|
||||
'plugins/surface/surface.vcxproj',
|
||||
'plugins/surface_idtech2/surface_idtech2.vcxproj',
|
||||
'contrib/camera/camera.vcxproj',
|
||||
'contrib/prtview/prtview.vcxproj',
|
||||
'contrib/hydratoolz/hydratoolz.vcxproj',
|
||||
'contrib/bobtoolz/bobtoolz.vcxproj',
|
||||
'contrib/gtkgensurf/gtkgensurf.vcxproj',
|
||||
'contrib/bkgrnd2d/bkgrnd2d.vcxproj'
|
||||
]:
|
||||
( libpath, libname ) = os.path.split( project )
|
||||
libname = os.path.splitext( libname )[0]
|
||||
|
@ -158,7 +158,7 @@ class Config:
|
|||
build_dir = os.path.join( 'build', config_name, compiler_name )
|
||||
VariantDir( build_dir, '.', duplicate = 0 )
|
||||
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.vcxproj', 'libs/mathlib/mathlib.vcxproj', 'libs/l_net/l_net.vcxproj', 'libs/ddslib/ddslib.vcxproj', 'libs/picomodel/picomodel.vcxproj', 'libs/md5lib/md5lib.vcxproj' ]:
|
||||
Export( 'project' )
|
||||
lib_objects += SConscript( os.path.join( build_dir, 'SConscript.lib' ) )
|
||||
Export( 'lib_objects' )
|
||||
|
@ -176,7 +176,7 @@ class 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' ]:
|
||||
for project in [ 'libs/mathlib/mathlib.vcxproj', 'libs/l_net/l_net.vcxproj', 'libs/ddslib/ddslib.vcxproj' ]:
|
||||
Export( 'project' )
|
||||
lib_objects += SConscript( os.path.join( build_dir, 'SConscript.lib' ) )
|
||||
Export( 'lib_objects' )
|
||||
|
|
7
utils.py
7
utils.py
|
@ -5,7 +5,7 @@
|
|||
|
||||
import os, commands, platform, xml.sax, re, string, platform
|
||||
|
||||
class vcproj( xml.sax.handler.ContentHandler ):
|
||||
class vcxproj( xml.sax.handler.ContentHandler ):
|
||||
def __init__( self, filepath ):
|
||||
self.source_files = []
|
||||
self.misc_files = []
|
||||
|
@ -29,8 +29,9 @@ class vcproj( xml.sax.handler.ContentHandler ):
|
|||
return ( match, nomatch )
|
||||
|
||||
def startElement( self, name, attrs ):
|
||||
if ( name == 'File' ):
|
||||
self._files.append( attrs.getValue('RelativePath') )
|
||||
if ( name == 'ClCompile' ):
|
||||
if ( attrs.has_key('Include') ):
|
||||
self._files.append( attrs.getValue('Include') )
|
||||
|
||||
def endDocument( self ):
|
||||
# split into source and headers, remap path seperator to the platform
|
||||
|
|
Loading…
Reference in a new issue