Detection works with more vs versions. Closes #332.

pull/334/head
Jussi Pakkanen 9 years ago
parent da0bd2acf7
commit eb2aefd038
  1. 4
      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) + '"')

Loading…
Cancel
Save