forked from TTimo/GtkRadiant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SConstruct
59 lines (47 loc) · 1.33 KB
/
SConstruct
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# -*- mode: python -*-
# GtkRadiant build scripts
# TTimo <[email protected]>
# http://scons.org/
import sys, os, platform, cPickle
import utils, config
conf_filename = 'site.sconf'
try:
sys.argv.index( '-h' )
except:
pass
else:
Help(
"""
======================================================================
ZeroRadiant build system quick help
You need scons v0.97.0d20070918.r2446 or newer
Default build (release), just run scons at the toplevel
debug build:
$ scons config=debug
======================================================================
""" )
Return()
active_configs = []
# load up configurations from the save file
if ( os.path.exists( conf_filename ) ):
f = open( conf_filename )
print 'reading saved configuration from site.conf'
try:
while ( True ):
c = cPickle.load( f )
active_configs.append( c )
except:
pass
# read the command line and build configs
config_statements = sys.argv[1:]
active_configs = config.ConfigParser().parseStatements( active_configs, config_statements )
assert( len( active_configs ) >= 1 )
# save the config
print 'saving updated configuration'
f = open( conf_filename, 'wb' )
for c in active_configs:
cPickle.dump( c, f, -1 )
print 'emit build rules'
for c in active_configs:
print 'emit configuration: %s' % repr( c )
c.emit()