From eb2aefd0381647ff1b9d18c6504f6d8f34d581cb Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sun, 13 Dec 2015 21:02:34 +0200 Subject: [PATCH] Detection works with more vs versions. Closes #332. --- environment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/environment.py b/environment.py index 8db4bd5df..e09f6ae36 100644 --- a/environment.py +++ b/environment.py @@ -202,7 +202,7 @@ class Environment(): return GnuCCompiler(ccache + [compiler], version, gtype, is_cross, exe_wrap) if 'clang' in out: return ClangCCompiler(ccache + [compiler], version, is_cross, exe_wrap) - if 'Microsoft' in out: + if 'Microsoft' in out or 'Microsoft' in err: # Visual Studio prints version number to stderr but # everything else to stdout. Why? Lord only knows. version = re.search(Environment.version_regex, err).group() @@ -326,7 +326,7 @@ class Environment(): return GnuCPPCompiler(ccache + [compiler], version, gtype, is_cross, exe_wrap) if 'clang' in out: return ClangCPPCompiler(ccache + [compiler], version, is_cross, exe_wrap) - if 'Microsoft' in out: + if 'Microsoft' in out or 'Microsoft' in err: version = re.search(Environment.version_regex, err).group() return VisualStudioCPPCompiler([compiler], version, is_cross, exe_wrap) raise EnvironmentException('Unknown compiler(s) "' + ', '.join(compilers) + '"')