Make msvc.py behave itself when other toolchains are loaded

Chain down to the pre-existing Task.exec_command() implementation
if task.env.CC_NAME indicates that the current taskgen isn't building
using Microsoft tools.

Issue 1237.

Signed-off-by: Thomas Nagy <tnagy2pow10@gmail.com>
This commit is contained in:
Matt Hoosier 2012-12-14 08:23:58 -06:00 committed by Thomas Nagy
parent 4b4aaf7dc5
commit 9b443a4e88
1 changed files with 18 additions and 15 deletions

View File

@ -970,7 +970,9 @@ def exec_command_msvc(self, *k, **kw):
Change the command-line execution for msvc programs. Change the command-line execution for msvc programs.
Instead of quoting all the paths and keep using the shell, we can just join the options msvc is interested in Instead of quoting all the paths and keep using the shell, we can just join the options msvc is interested in
""" """
if self.env['CC_NAME'] == 'msvc': if self.env['CC_NAME'] != 'msvc':
return self.exec_command_nomsvc(*k, **kw)
if isinstance(k[0], list): if isinstance(k[0], list):
lst = [] lst = []
carry = '' carry = ''
@ -1002,6 +1004,7 @@ def exec_command_msvc(self, *k, **kw):
for k in 'c cxx cprogram cxxprogram cshlib cxxshlib cstlib cxxstlib'.split(): for k in 'c cxx cprogram cxxprogram cshlib cxxshlib cstlib cxxstlib'.split():
cls = Task.classes.get(k, None) cls = Task.classes.get(k, None)
if cls: if cls:
cls.exec_command_nomsvc = cls.exec_command
cls.exec_command = exec_command_msvc cls.exec_command = exec_command_msvc
cls.exec_response_command = exec_response_command cls.exec_response_command = exec_response_command
cls.quote_response_command = quote_response_command cls.quote_response_command = quote_response_command