Fix detection of MSVC 2008 version.

pull/2243/head
Philippe Payant 7 years ago committed by Jussi Pakkanen
parent f381284969
commit fc92991e34
  1. 10
      mesonbuild/environment.py

@ -539,10 +539,14 @@ class Environment:
cls = ClangCCompiler if lang == 'c' else ClangCPPCompiler
return cls(ccache + compiler, version, cltype, is_cross, exe_wrap)
if 'Microsoft' in out or 'Microsoft' in err:
# Visual Studio prints version number to stderr but
# everything else to stdout. Why? Lord only knows.
# Latest versions of Visual Studio print version
# number to stderr but earlier ones print version
# on stdout. Why? Lord only knows.
# Check both outputs to figure out version.
version = search_version(err)
if not err or not err.split('\n')[0]:
if version == 'unknown version':
version = search_version(out)
if version == 'unknown version':
m = 'Failed to detect MSVC compiler arch: stderr was\n{!r}'
raise EnvironmentException(m.format(err))
is_64 = err.split('\n')[0].endswith(' x64')

Loading…
Cancel
Save