Fix for MinGW compilation

This commit is contained in:
Lee Zher Huei 2014-12-27 16:42:37 +00:00
parent 530d717a67
commit 645a038568
1 changed files with 22 additions and 2 deletions

View File

@ -170,6 +170,26 @@ if selected_platform in platform_list:
else: else:
env = env_base.Clone() env = env_base.Clone()
# Workaround for MinGW. See:
# http://www.scons.org/wiki/LongCmdLinesOnWin32
if (os.name=="nt"):
import subprocess
def mySpawn(sh, escape, cmd, args, env):
newargs = ' '.join(args[1:])
cmdline = cmd + " " + newargs
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, startupinfo=startupinfo, shell = False, env = env)
data, err = proc.communicate()
rv = proc.wait()
if rv:
print "====="
print err
print "====="
return rv
env['SPAWN'] = mySpawn
env.extra_suffix="" env.extra_suffix=""
CCFLAGS = env.get('CCFLAGS', '') CCFLAGS = env.get('CCFLAGS', '')