From 25d8c5c32ac76c2ba80afe1f5273f670a1ca7311 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Mon, 20 Jun 2016 17:51:25 +0100 Subject: [PATCH] #4978 Added script to support VS2015 --- ext/toolchain/commands1.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py index dc26cc76..503b05f1 100644 --- a/ext/toolchain/commands1.py +++ b/ext/toolchain/commands1.py @@ -254,13 +254,15 @@ class InternalCommands: gmockDir = 'gmock-1.6.0' win32_generators = { - 1 : VisualStudioGenerator('10'), - 2 : VisualStudioGenerator('10 Win64'), - 3 : VisualStudioGenerator('9 2008'), - 4 : VisualStudioGenerator('9 2008 Win64'), - 5 : VisualStudioGenerator('8 2005'), - 6 : VisualStudioGenerator('8 2005 Win64') - } + 1 : VisualStudioGenerator('14'), + 2 : VisualStudioGenerator('14 Win64'), + 3 : VisualStudioGenerator('10'), + 4 : VisualStudioGenerator('10 Win64'), + 5 : VisualStudioGenerator('9 2008'), + 6 : VisualStudioGenerator('9 2008 Win64'), + 7 : VisualStudioGenerator('8 2005'), + 8 : VisualStudioGenerator('8 2005 Win64'), + } unix_generators = { 1 : MakefilesGenerator(), @@ -899,8 +901,8 @@ class InternalCommands: generator = self.getGeneratorFromConfig().cmakeName if generator.startswith('Visual Studio'): - # special case for version 10, use new /target:clean - if generator.startswith('Visual Studio 10'): + # special case for version 10 and above, use new /target:clean + if generator.startswith('Visual Studio 10') or generator.startswith('Visual Studio 14'): for target in targets: self.run_vcbuild(generator, target, self.sln_filepath(), '/target:clean') @@ -1750,6 +1752,8 @@ class InternalCommands: value,type = _winreg.QueryValueEx(key, '9.0') elif generator.startswith('Visual Studio 10'): value,type = _winreg.QueryValueEx(key, '10.0') + elif generator.startswith('Visual Studio 14'): + value,type = _winreg.QueryValueEx(key, '14.0') else: raise Exception('Cannot determine vcvarsall.bat location for: ' + generator) @@ -1792,7 +1796,7 @@ class InternalCommands: else: config = 'Debug' - if generator.startswith('Visual Studio 10'): + if generator.startswith('Visual Studio 10') or generator.startswith('Visual Studio 14'): cmd = ('@echo off\n' 'call "%s" %s \n' 'cd "%s"\n'