summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Zher Huei <lee.zh.92@gmail.com>2014-12-27 16:42:37 +0000
committerLee Zher Huei <lee.zh.92@gmail.com>2014-12-27 16:42:37 +0000
commit645a0385687fc2deefdb47f73eb4415932987c42 (patch)
tree3f74994151dc0b44ca8ce9984b7e7038e8897649
parent530d717a67cc3acab10270dca700db328aa12891 (diff)
Fix for MinGW compilation
-rw-r--r--SConstruct24
1 files changed, 22 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct
index 42e9085171..f5aa0cd1bd 100644
--- a/SConstruct
+++ b/SConstruct
@@ -133,8 +133,8 @@ Help(opts.GenerateHelpText(env_base)) # generate help
# add default include paths
env_base.Append(CPPPATH=['#core','#core/math','#tools','#drivers','#'])
-
-# configure ENV for platform
+
+# configure ENV for platform
env_base.platform_exporters=platform_exporters
"""
@@ -170,6 +170,26 @@ if selected_platform in platform_list:
else:
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=""
CCFLAGS = env.get('CCFLAGS', '')