Raise an exception if we cannot detect the MSVC compiler target architecture

pull/6173/head
Luca Bacci 5 years ago committed by Jussi Pakkanen
parent 4e460f04f3
commit ad20067ed2
  1. 6
      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(

Loading…
Cancel
Save