forked from bartvdbraak/blender
==SCons==
If win32all (http://sourceforge.net/project/showfiles.php?group_id=78018) is found, use it to be able to build with scons/mingw in (very) long paths. If it is not found, don't do anything groovy. This should make it possible to merge the cut up src lib. Those concerned, please do test that. This bit of code is from http://www.scons.org/wiki/LongCmdLinesOnWin32
This commit is contained in:
parent
01ab6d6f75
commit
2f3c52bd67
46
SConstruct
46
SConstruct
@ -129,6 +129,52 @@ if env['CC'] in ['cl', 'cl.exe'] and sys.platform=='win32':
|
||||
elif env['CC'] in ['gcc'] and sys.platform=='win32':
|
||||
platform = 'win32-mingw'
|
||||
|
||||
if platform == 'win32-mingw':
|
||||
try:
|
||||
import win32file
|
||||
import win32event
|
||||
import win32process
|
||||
import win32security
|
||||
import string
|
||||
|
||||
slash= re.compile(r"\\")
|
||||
|
||||
def myesc(b):
|
||||
if b[0]!= "-":
|
||||
b = slash.sub(r"\\\\", b[1:-1])
|
||||
return "\"" + b + "\""
|
||||
else:
|
||||
return b
|
||||
|
||||
def my_spawn(sh, escape, cmd, args, spawnenv):
|
||||
for var in spawnenv:
|
||||
spawnenv[var] = spawnenv[var].encode('ascii', 'replace')
|
||||
|
||||
sAttrs = win32security.SECURITY_ATTRIBUTES()
|
||||
StartupInfo = win32process.STARTUPINFO()
|
||||
if cmd=='ar' and args[1]=='r':
|
||||
args[1] = '-r'
|
||||
newargs = string.join(map(myesc, args[1:]), ' ')
|
||||
cmdline = cmd + " " + newargs
|
||||
|
||||
# check for any special operating system commands
|
||||
if cmd == 'del':
|
||||
for arg in args[1:]:
|
||||
win32file.DeleteFile(arg)
|
||||
exit_code = 0
|
||||
else:
|
||||
# otherwise execute the command.
|
||||
hProcess, hThread, dwPid, dwTid = win32process.CreateProcess(None, cmdline, None, None, 1, 0, spawnenv, None, StartupInfo)
|
||||
win32event.WaitForSingleObject(hProcess, win32event.INFINITE)
|
||||
exit_code = win32process.GetExitCodeProcess(hProcess)
|
||||
win32file.CloseHandle(hProcess);
|
||||
win32file.CloseHandle(hThread);
|
||||
return exit_code
|
||||
|
||||
env['SPAWN'] = my_spawn
|
||||
except:
|
||||
print "install win32all from http://sourceforge.net/project/showfiles.php?group_id=78018"
|
||||
|
||||
crossbuild = B.arguments.get('BF_CROSS', None)
|
||||
if crossbuild and platform!='win32':
|
||||
platform = 'linuxcross'
|
||||
|
Loading…
Reference in New Issue
Block a user