Skip to content

Commit afa65e3

Browse files
committed
sconsProject: some improvments
* deal with "path too long" issues (disabled until it works) * qt.py updated solving moc.exe that generates too long include paths * qt.py updated to deal with translations
1 parent be912ec commit afa65e3

File tree

2 files changed

+335
-270
lines changed

2 files changed

+335
-270
lines changed

__init__.py

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,27 @@ def join_if_basedir_not_empty( *dirs ):
3131
return ''
3232
return os.path.join(*dirs)
3333

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
3455

3556
class SConsProject:
3657
'''
@@ -111,7 +132,7 @@ def createCustomPlugins( self, sources=[], libs=[] ):
111132
'scripttest',
112133
] + (['msvs'] if windows else []),
113134
toolpath=[os.path.join(dir_sconsProject,'tools')] )
114-
135+
115136
allVisualProjects = []
116137

117138
def __init__(self):
@@ -170,6 +191,8 @@ def __init__(self):
170191
#if self.windows:
171192
self.env['ENV']['PATH'] = os.environ['PATH'] # access to the compiler (if not in '/usr/bin')
172193

194+
# setupSpawn( self.env );
195+
173196
# scons optimizations...
174197
# http://www.scons.org/wiki/GoFastButton
175198
#
@@ -669,7 +692,6 @@ def applyOptionsOnEnv(self, env):
669692
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']:
670693
env[c] = ''
671694

672-
673695
def SConscript(self, dirs=[], exports=[]):
674696
'''
675697
To include SConscript from SConstruct, this automatically defines variantdirs.
@@ -1281,7 +1303,7 @@ def SharedLibrary( self, target,
12811303
sourcesFiles = sourcesFiles + localEnv['ADDSRC']
12821304

12831305
sourcesFiles = self.getAbsoluteCwd( sourcesFiles )
1284-
1306+
12851307
#adding precompiled headers
12861308
if precinc and self.windows:
12871309
localEnv['PCHSTOP'] = self.getRealAbsoluteCwd() + '/' + precinc

0 commit comments

Comments
 (0)