aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Bacci <luca.bacci982@gmail.com>2019-11-08 12:33:45 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2019-11-12 20:31:37 +0200
commitad20067ed2a29705002828ceb33a92d3ed2df7a6 (patch)
tree129e10e358a38bd35c68f58f54ab3184beed6260
parent4e460f04f3b2d767027c7769bab6eb8029b22422 (diff)
downloadmeson-ad20067ed2a29705002828ceb33a92d3ed2df7a6.zip
meson-ad20067ed2a29705002828ceb33a92d3ed2df7a6.tar.gz
meson-ad20067ed2a29705002828ceb33a92d3ed2df7a6.tar.bz2
Raise an exception if we cannot detect the MSVC compiler target architecture
-rw-r--r--mesonbuild/environment.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 5f3c25f..072e7c3 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(