Identify machine in error accesing compiler object for missing language

Also add a failing test case for that error.
pull/7021/head
Jon Turney 5 years ago committed by Nirbheek Chauhan
parent 7996ca3d55
commit 79b2eeb1ba
  1. 2
      mesonbuild/interpreter.py
  2. 2
      test cases/failing/109 compiler no lang/meson.build
  3. 7
      test cases/failing/109 compiler no lang/test.json

@ -2093,7 +2093,7 @@ class MesonMain(InterpreterObject):
clist = self.interpreter.coredata.compilers[for_machine]
if cname in clist:
return CompilerHolder(clist[cname], self.build.environment, self.interpreter.subproject)
raise InterpreterException('Tried to access compiler for unspecified language "%s".' % cname)
raise InterpreterException('Tried to access compiler for language "%s", not specified for %s machine.' % (cname, for_machine.get_lower_case_name()))
@noPosargs
@permittedKwargs({})

@ -0,0 +1,2 @@
project('compiler without lang')
meson.get_compiler('c')

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/109 compiler no lang/meson.build:2:6: ERROR: Tried to access compiler for language \"c\", not specified for host machine."
}
]
}
Loading…
Cancel
Save