diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-08-08 11:14:28 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-08-08 11:14:28 -0300 |
commit | 0a139aaef9971416715375c813a51a1a451245e1 (patch) | |
tree | 0dbbf2ece60ce1336b1e4e9fa706d453bdc4420b /platform/android | |
parent | b3dff195e031c4ecce4e7d055e184f41420493c1 (diff) | |
parent | 9983ceecf25a4110793aeeae0378b2b50316f34d (diff) |
Merge pull request #2302 from antonyjones67/AndroidTemplateCompileWindows
Fixes compile bug for Android template on Windows.
Diffstat (limited to 'platform/android')
-rw-r--r-- | platform/android/detect.py | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/platform/android/detect.py b/platform/android/detect.py index 5ef405f7b6..76575a1ec6 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -54,13 +54,53 @@ def create(env): def configure(env): + # Workaround for MinGW. See: + # http://www.scons.org/wiki/LongCmdLinesOnWin32 + import os + if (os.name=="nt"): + + import subprocess + + def mySubProcess(cmdline,env): + #print "SPAWNED : " + cmdline + 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 + + def mySpawn(sh, escape, cmd, args, env): + + newargs = ' '.join(args[1:]) + cmdline = cmd + " " + newargs + + rv=0 + if len(cmdline) > 32000 and cmd.endswith("ar") : + cmdline = cmd + " " + args[1] + " " + args[2] + " " + for i in range(3,len(args)) : + rv = mySubProcess( cmdline + args[i], env ) + if rv : + break + else: + rv = mySubProcess( cmdline, env ) + + return rv + + env['SPAWN'] = mySpawn + if env['x86']=='yes': env['NDK_TARGET']='x86-4.8' if env['PLATFORM'] == 'win32': import methods env.Tool('gcc') - env['SPAWN'] = methods.win32_spawn + #env['SPAWN'] = methods.win32_spawn env['SHLIBSUFFIX'] = '.so' # env.android_source_modules.append("../libs/apk_expansion") |