diff options
author | Simon Warta <[email protected]> | 2017-07-30 00:25:39 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2017-07-30 00:25:39 +0200 |
commit | 863908ebf39eea99ef0d0356cb30cbca0fa87b22 (patch) | |
tree | 4ee25afb7fa1b5dd17bf69d993693ecaa6b6baf1 /configure.py | |
parent | efc57e680682407fb21c14f16a8dbdff88bcbc57 (diff) |
Fix compiler version matching patterns
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/configure.py b/configure.py index 311c04e5b..fe65edcc6 100755 --- a/configure.py +++ b/configure.py @@ -2578,9 +2578,9 @@ class CompilerDetector(object): 'clang': ['-v'], } _version_patterns = { - 'msvc': r'Compiler Version ([0-9]+).([0-9]+).[0-9\.]+ for', - 'gcc': r'gcc version ([0-9]+.[0-9])+.[0-9]+', - 'clang': r'clang version ([0-9]+.[0-9])[ \.]', + 'msvc': r'Compiler Version ([0-9]+\.[0-9]+)\.[0-9\.]+ for', + 'gcc': r'gcc version ([0-9]+\.[0-9]+)\.[0-9]+', + 'clang': r'clang version ([0-9]+\.[0-9])[ \.]', } def __init__(self, cc_name, cc_bin, os_name): @@ -2619,12 +2619,10 @@ class CompilerDetector(object): '19.00': '2015', '19.10': '2017' } - cl_version = match.group(1) + '.' + match.group(2) - if cl_version in cl_version_to_msvc_version: - cc_version = cl_version_to_msvc_version[cl_version] - else: - logging.warning('Unable to determine MSVC version from output "%s"' % (cc_output)) - return None + try: + cc_version = cl_version_to_msvc_version[match.group(1)] + except KeyError: + raise InternalError('Unknown MSVC version in output "%s"' % (cc_output)) else: cc_version = match.group(1) elif match is None and self._cc_name == 'clang' and self._os_name in ['darwin', 'ios']: |