-Many fixes to windows build system with Mingw on Windows. Fixes #2690
This commit is contained in:
parent
caff4000a2
commit
caddcca4f4
|
@ -1,5 +1,6 @@
|
||||||
EnsureSConsVersion(0,14);
|
EnsureSConsVersion(0,14);
|
||||||
|
|
||||||
|
|
||||||
import string
|
import string
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
|
@ -77,6 +78,9 @@ env_base.android_permission_chunk=""
|
||||||
env_base.android_appattributes_chunk=""
|
env_base.android_appattributes_chunk=""
|
||||||
env_base.disabled_modules=[]
|
env_base.disabled_modules=[]
|
||||||
|
|
||||||
|
env_base.split_drivers=False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
env_base.__class__.android_add_maven_repository=methods.android_add_maven_repository
|
env_base.__class__.android_add_maven_repository=methods.android_add_maven_repository
|
||||||
env_base.__class__.android_add_dependency=methods.android_add_dependency
|
env_base.__class__.android_add_dependency=methods.android_add_dependency
|
||||||
|
@ -90,6 +94,7 @@ env_base.__class__.android_add_to_attributes = methods.android_add_to_attributes
|
||||||
env_base.__class__.disable_module = methods.disable_module
|
env_base.__class__.disable_module = methods.disable_module
|
||||||
|
|
||||||
env_base.__class__.add_source_files = methods.add_source_files
|
env_base.__class__.add_source_files = methods.add_source_files
|
||||||
|
env_base.__class__.use_windows_spawn_fix = methods.use_windows_spawn_fix
|
||||||
|
|
||||||
env_base["x86_opt_gcc"]=False
|
env_base["x86_opt_gcc"]=False
|
||||||
env_base["x86_opt_vc"]=False
|
env_base["x86_opt_vc"]=False
|
||||||
|
|
|
@ -63,7 +63,7 @@ import string
|
||||||
if env['vsproj']=="yes":
|
if env['vsproj']=="yes":
|
||||||
env.AddToVSProject(env.drivers_sources)
|
env.AddToVSProject(env.drivers_sources)
|
||||||
|
|
||||||
if (False): #split drivers, this used to be needed for windows until separate builders for windows were created
|
if (env.split_drivers): #split drivers, this used to be needed for windows until separate builders for windows were created
|
||||||
|
|
||||||
for f in env.drivers_sources:
|
for f in env.drivers_sources:
|
||||||
fname = ""
|
fname = ""
|
||||||
|
|
45
methods.py
45
methods.py
|
@ -1309,7 +1309,50 @@ def android_add_to_attributes(self,file):
|
||||||
|
|
||||||
def disable_module(self):
|
def disable_module(self):
|
||||||
self.disabled_modules.append(self.current_module)
|
self.disabled_modules.append(self.current_module)
|
||||||
|
|
||||||
|
def use_windows_spawn_fix(self):
|
||||||
|
|
||||||
|
if (os.name!="nt"):
|
||||||
|
return #not needed, only for windows
|
||||||
|
|
||||||
|
self.split_drivers=True
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
self['SPAWN'] = mySpawn
|
||||||
|
|
||||||
|
|
||||||
def save_active_platforms(apnames,ap):
|
def save_active_platforms(apnames,ap):
|
||||||
|
|
||||||
for x in ap:
|
for x in ap:
|
||||||
|
|
|
@ -267,41 +267,7 @@ def configure(env):
|
||||||
|
|
||||||
# Workaround for MinGW. See:
|
# Workaround for MinGW. See:
|
||||||
# http://www.scons.org/wiki/LongCmdLinesOnWin32
|
# http://www.scons.org/wiki/LongCmdLinesOnWin32
|
||||||
if (os.name=="nt"):
|
env.use_windows_spawn_fix()
|
||||||
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
|
|
||||||
|
|
||||||
#build using mingw
|
#build using mingw
|
||||||
if (os.name=="nt"):
|
if (os.name=="nt"):
|
||||||
|
|
Loading…
Reference in New Issue