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) + '"')