@@ -31,6 +31,27 @@ def join_if_basedir_not_empty( *dirs ):
31
31
return ''
32
32
return os .path .join (* dirs )
33
33
34
+ class VisualCSpawn :
35
+ def visualcspawn (self , sh , escape , cmd , args , env ):
36
+ newargs = ' ' .join (args [1 :])
37
+ cmdline = cmd + " " + newargs
38
+ startupinfo = subprocess .STARTUPINFO ()
39
+ startupinfo .dwFlags |= subprocess .STARTF_USESHOWWINDOW
40
+ proc = subprocess .Popen (cmdline , stdin = subprocess .PIPE , stdout = subprocess .PIPE ,
41
+ stderr = subprocess .PIPE , startupinfo = startupinfo , shell = False , env = env )
42
+ data , err = proc .communicate ()
43
+ rv = proc .wait ()
44
+ if rv :
45
+ print "====="
46
+ print err
47
+ print "====="
48
+ return rv
49
+
50
+ def setupSpawn ( env ):
51
+ if sys .platform == 'win32' :
52
+ buf = VisualCSpawn ()
53
+ buf .visualCSpawnEnv = env
54
+ env ['SPAWN' ] = buf .visualcspawn
34
55
35
56
class SConsProject :
36
57
'''
@@ -111,7 +132,7 @@ def createCustomPlugins( self, sources=[], libs=[] ):
111
132
'scripttest' ,
112
133
] + (['msvs' ] if windows else []),
113
134
toolpath = [os .path .join (dir_sconsProject ,'tools' )] )
114
-
135
+
115
136
allVisualProjects = []
116
137
117
138
def __init__ (self ):
@@ -170,6 +191,8 @@ def __init__(self):
170
191
#if self.windows:
171
192
self .env ['ENV' ]['PATH' ] = os .environ ['PATH' ] # access to the compiler (if not in '/usr/bin')
172
193
194
+ # setupSpawn( self.env );
195
+
173
196
# scons optimizations...
174
197
# http://www.scons.org/wiki/GoFastButton
175
198
#
@@ -669,7 +692,6 @@ def applyOptionsOnEnv(self, env):
669
692
for c in ['color_clear' , 'color_red' , 'color_redB' , 'color_green' , 'color_blue' , 'color_blueB' , 'color_yellow' , 'color_brown' , 'color_violet' , 'color_autoconf' , 'color_header' , 'color_title' , 'color_compile' , 'color_link' , 'color_install' , 'color_info' , 'color_success' , 'color_warning' , 'color_fail' , 'color_error' ]:
670
693
env [c ] = ''
671
694
672
-
673
695
def SConscript (self , dirs = [], exports = []):
674
696
'''
675
697
To include SConscript from SConstruct, this automatically defines variantdirs.
@@ -1281,7 +1303,7 @@ def SharedLibrary( self, target,
1281
1303
sourcesFiles = sourcesFiles + localEnv ['ADDSRC' ]
1282
1304
1283
1305
sourcesFiles = self .getAbsoluteCwd ( sourcesFiles )
1284
-
1306
+
1285
1307
#adding precompiled headers
1286
1308
if precinc and self .windows :
1287
1309
localEnv ['PCHSTOP' ] = self .getRealAbsoluteCwd () + '/' + precinc
0 commit comments