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