Error out if using a not found binary in the build. Closes #469.

pull/475/head
Jussi Pakkanen 9 years ago
parent 8945c85f96
commit 317a735b07
  1. 2
      mesonbuild/build.py
  2. 9
      test cases/failing/28 noprog use/meson.build

@ -842,6 +842,8 @@ class CustomTarget:
if isinstance(c, str):
final_cmd.append(c)
elif isinstance(c, dependencies.ExternalProgram):
if not c.found():
raise InvalidArguments('Tried to use not found external program in a build rule.')
final_cmd += c.get_command()
elif isinstance(c, BuildTarget) or isinstance(c, CustomTarget):
self.dependencies.append(c)

@ -0,0 +1,9 @@
project('using not found exe', 'c')
nope = find_program('nonexisting', required : false)
custom_target( 'aa',
input: 'meson.build',
output: 'foobar',
command: [nope, '@INPUT@', '@OUTPUT@']
)
Loading…
Cancel
Save