diff options
author | Philippe Payant <philippe@inrosoftware.com> | 2017-08-22 10:27:26 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-08-23 15:22:02 +0300 |
commit | fc92991e349418029aaf5e9343946df5f3db1066 (patch) | |
tree | 3b94eab0e7df8b230ac8d52ca4d76fbcdacac03a /mesonbuild/environment.py | |
parent | f381284969a9641723cd0bce0768c7d6820e61c8 (diff) | |
download | meson-fc92991e349418029aaf5e9343946df5f3db1066.zip meson-fc92991e349418029aaf5e9343946df5f3db1066.tar.gz meson-fc92991e349418029aaf5e9343946df5f3db1066.tar.bz2 |
Fix detection of MSVC 2008 version.
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 1405c06..5e0d683 100644 --- a/mesonbuild/environment.py +++ b/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') |