From abbf850d56bad3d08a15741c94e7ca67f4db26fb Mon Sep 17 00:00:00 2001 From: DietmarSchwertberger Date: Sun, 6 Dec 2015 21:34:45 +0100 Subject: [PATCH] Add support for Visual Studio 2015 and encoding issues Replace 'touch' command with Python implementation to reduce dependency on cygwin. --- buildtools/config.py | 4 +++- wscript | 11 ++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/buildtools/config.py b/buildtools/config.py index 1232afe5..ff947ea8 100644 --- a/buildtools/config.py +++ b/buildtools/config.py @@ -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' diff --git a/wscript b/wscript index e242bfee..f80e94e7 100644 --- a/wscript +++ b/wscript @@ -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