Fixes compile bug for Android template on Windows.
This commit is contained in:
parent
d50ebbb441
commit
9983ceecf2
3 changed files with 52 additions and 6 deletions
11
SConstruct
11
SConstruct
|
@ -54,13 +54,16 @@ methods.save_active_platforms(active_platforms,active_platform_ids)
|
||||||
|
|
||||||
custom_tools=['default']
|
custom_tools=['default']
|
||||||
|
|
||||||
|
platform_arg = ARGUMENTS.get("platform", False)
|
||||||
|
|
||||||
if (os.name=="posix"):
|
if (os.name=="posix"):
|
||||||
pass
|
pass
|
||||||
elif (os.name=="nt"):
|
elif (os.name=="nt"):
|
||||||
if (os.getenv("VSINSTALLDIR")==None):
|
if (os.getenv("VSINSTALLDIR")==None or platform_arg=="android"):
|
||||||
custom_tools=['mingw']
|
custom_tools=['mingw']
|
||||||
|
|
||||||
env_base=Environment(tools=custom_tools,ENV = {'PATH' : os.environ['PATH']});
|
env_base=Environment(tools=custom_tools,ENV = {'PATH' : os.environ['PATH']});
|
||||||
|
|
||||||
#env_base=Environment(tools=custom_tools);
|
#env_base=Environment(tools=custom_tools);
|
||||||
env_base.global_defaults=global_defaults
|
env_base.global_defaults=global_defaults
|
||||||
env_base.android_source_modules=[]
|
env_base.android_source_modules=[]
|
||||||
|
@ -363,8 +366,8 @@ if selected_platform in platform_list:
|
||||||
|
|
||||||
#env['MSVS_VERSION']='9.0'
|
#env['MSVS_VERSION']='9.0'
|
||||||
env['MSVSBUILDCOM'] = "scons platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes"
|
env['MSVSBUILDCOM'] = "scons platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes"
|
||||||
env['MSVSREBUILDCOM'] = "scons platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes"
|
env['MSVSREBUILDCOM'] = "scons platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes vsproj=true"
|
||||||
env['MSVSCLEANCOM'] = "scons platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes"
|
env['MSVSCLEANCOM'] = "scons --clean platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes"
|
||||||
|
|
||||||
debug_variants = ['Debug|Win32']+['Debug|x64']
|
debug_variants = ['Debug|Win32']+['Debug|x64']
|
||||||
release_variants = ['Release|Win32']+['Release|x64']
|
release_variants = ['Release|Win32']+['Release|x64']
|
||||||
|
|
|
@ -27,7 +27,10 @@ if ("neon_enabled" in env and env["neon_enabled"]):
|
||||||
if "S_compiler" in env:
|
if "S_compiler" in env:
|
||||||
env_neon['CC'] = env['S_compiler']
|
env_neon['CC'] = env['S_compiler']
|
||||||
env_neon.Append(CPPFLAGS=["-DPNG_ARM_NEON"])
|
env_neon.Append(CPPFLAGS=["-DPNG_ARM_NEON"])
|
||||||
png_sources.append(env_neon.Object("#drivers/png/filter_neon.S"))
|
import os
|
||||||
|
# Currently .ASM filter_neon.S does not compile on NT.
|
||||||
|
if (os.name!="nt"):
|
||||||
|
png_sources.append(env_neon.Object("#drivers/png/filter_neon.S"))
|
||||||
|
|
||||||
|
|
||||||
env.drivers_sources+=png_sources
|
env.drivers_sources+=png_sources
|
||||||
|
|
|
@ -54,13 +54,53 @@ def create(env):
|
||||||
|
|
||||||
def configure(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':
|
if env['x86']=='yes':
|
||||||
env['NDK_TARGET']='x86-4.8'
|
env['NDK_TARGET']='x86-4.8'
|
||||||
|
|
||||||
if env['PLATFORM'] == 'win32':
|
if env['PLATFORM'] == 'win32':
|
||||||
import methods
|
import methods
|
||||||
env.Tool('gcc')
|
env.Tool('gcc')
|
||||||
env['SPAWN'] = methods.win32_spawn
|
#env['SPAWN'] = methods.win32_spawn
|
||||||
env['SHLIBSUFFIX'] = '.so'
|
env['SHLIBSUFFIX'] = '.so'
|
||||||
|
|
||||||
# env.android_source_modules.append("../libs/apk_expansion")
|
# env.android_source_modules.append("../libs/apk_expansion")
|
||||||
|
|
Loading…
Reference in a new issue