Add support for Visual Studio 2015 and encoding issues

Replace 'touch' command with Python implementation to reduce dependency on cygwin.
This commit is contained in:
DietmarSchwertberger
2015-12-06 21:34:45 +01:00
committed by Robin Dunn
parent 964307cbb7
commit abbf850d56
2 changed files with 7 additions and 8 deletions

View File

@@ -789,7 +789,7 @@ def runcmd(cmd, getOutput=False, echoCmd=True, fatal=True):
if getOutput:
output = sp.stdout.read()
if sys.version_info > (3,):
output = output.decode('utf-8') # TODO: is utf-8 okay here?
output = output.decode('utf-8', 'ignore') # TODO: is utf-8 okay here?
output = output.rstrip()
rval = sp.wait()
@@ -850,6 +850,8 @@ def getVisCVersion():
return '90'
if 'Version 16' in text:
return '100'
if 'Version 19' in text:
return '140'
# TODO: Add more tests to get the other versions...
else:
return 'FIXME'

11
wscript
View File

@@ -68,12 +68,8 @@ def configure(conf):
# version. We have a chicken-egg problem here. The compiler needs to
# be selected before the Python stuff can be configured, but we need
# Python to know what version of the compiler to use.
# TODO: Fix this
msvc_version = '9.0' #conf.options.msvc_ver
if conf.options.python and ('33' in conf.options.python or
'34' in conf.options.python):
msvc_version = '10.0'
import distutils.msvc9compiler
msvc_version = str( distutils.msvc9compiler.get_build_version() )
conf.env['MSVC_VERSIONS'] = ['msvc ' + msvc_version]
conf.env['MSVC_TARGETS'] = [conf.options.msvc_arch]
conf.load('msvc')
@@ -616,7 +612,8 @@ def copyFileToPkg(task):
from buildtools.config import opj
src = task.inputs[0].abspath()
tgt = task.outputs[0].abspath()
task.exec_command('touch %s' % tgt)
#task.exec_command('touch %s' % tgt)
open(tgt, "wb").close() # 'touch'
tgt = opj(cfg.PKGDIR, os.path.basename(src))
copy_file(src, tgt, verbose=1)
return 0