]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - SConscript.module
* added filter api to create new filters from within plugins
[xonotic/netradiant.git] / SConscript.module
1 # -*- mode: python -*-
2 # ZeroRadiant build scripts
3 # TTimo <ttimo@idsoftware.com>
4 # http://scons.sourceforge.net
5
6 import os
7
8 Import( [ 'utils', 'config', 'settings', 'project', 'shlib_objects' ] )
9
10 ( libpath, libname ) = os.path.split( project )
11 libname = os.path.splitext( libname )[0]
12
13 env = Environment()
14 useJPEG = False
15 useGtk = False
16 if ( libname == 'image' ):
17         useJPEG = True
18 if ( libname == 'surface' ):
19         useGtk = True
20 if ( libname == 'surface_ufoai' ):
21         useGtk = True
22 if ( libname == 'surface_quake2' ):
23         useGtk = True
24 if ( libname == 'surface_heretic2' ):
25         useGtk = True
26 if ( libname == 'bkgrnd2d' ):
27         useGtk = True
28 if ( libname == 'gtkgensurf' ):
29         useGtk = True
30 if ( libname == 'bobToolz_gtk' ):
31         useGtk = True
32 if ( libname == 'camera' ):
33         useGtk = True
34 if ( libname == 'PrtView' ):
35         useGtk = True
36 if ( libname == 'spritemodel' ):
37         useGtk = True
38 if ( libname == 'model' ):
39         useGtk = True
40 if ( libname == 'TexTool' ):
41         useGtk = True
42
43 settings.SetupEnvironment( env, config['name'], useGtk = useGtk, useJPEG = useJPEG )
44 proj = utils.vcproj( os.path.join( GetLaunchDir(), project ) )
45
46 # some filtering. may need to improve that
47 add_sources = []
48 ( drop, files ) = proj.filterSource( r'.*l_net_wins\.c' )
49 if ( len( drop ) != 0 ):
50         add_sources.append( 'l_net_berkeley.c' )
51
52 module_base = env.SharedLibrary( os.path.join( 'modules', libname ), shlib_objects + [ os.path.join( libpath, i ) for i in files ] )
53 module = env.AddPostAction( module_base, utils.CheckUnresolved )
54
55 Return( 'module' )