From ad20067ed2a29705002828ceb33a92d3ed2df7a6 Mon Sep 17 00:00:00 2001 From: Luca Bacci Date: Fri, 8 Nov 2019 12:33:45 +0100 Subject: [PATCH] Raise an exception if we cannot detect the MSVC compiler target architecture --- mesonbuild/environment.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 5f3c25ff7..072e7c360 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -990,11 +990,13 @@ class Environment: else: m = 'Failed to detect MSVC compiler version: stderr was\n{!r}' raise EnvironmentException(m.format(err)) - match = re.search(' for .*(x86|x64|ARM|ARM64)$', lookat.split('\n')[0]) + cl_signature = lookat.split('\n')[0] + match = re.search(' for .*(x86|x64|ARM|ARM64)$', cl_signature) if match: target = match.group(1) else: - target = 'x86' + m = 'Failed to detect MSVC compiler target architecture: \'cl /?\' output is\n{}' + raise EnvironmentException(m.format(cl_signature)) linker = MSVCDynamicLinker(for_machine, version=version) cls = VisualStudioCCompiler if lang == 'c' else VisualStudioCPPCompiler return cls(