Run_target can run binaries obtained with find_program.

pull/617/merge
Jussi Pakkanen 9 years ago
parent 4934e70092
commit ea4fe8e417
  1. 2
      mesonbuild/backend/ninjabackend.py
  2. 2
      mesonbuild/interpreter.py
  3. 3
      test cases/common/58 run target/meson.build

@ -425,6 +425,8 @@ int dummy;
if exe_wrap is not None:
cmd += [exe_wrap]
cmd.append(abs_exe)
elif isinstance(texe, dependencies.ExternalProgram):
cmd += texe.get_command()
else:
cmd.append(target.command)
cmd += arg_strings

@ -1768,7 +1768,7 @@ class Interpreter():
i = i.held_object
except AttributeError:
pass
if not isinstance(i, (str, build.BuildTarget, build.CustomTarget)):
if not isinstance(i, (str, build.BuildTarget, build.CustomTarget, dependencies.ExternalProgram)):
mlog.debug('Wrong type:', str(i))
raise InterpreterException('Invalid argument to run_target.')
cleaned_args.append(i)

@ -7,3 +7,6 @@ run_target('mycommand', 'scripts/script.sh')
exe = executable('helloprinter', 'helloprinter.c')
run_target('runhello', exe, 'argument')
python3 = find_program('python3')
run_target('py3hi', python3, '-c', 'print("I am Python3.")')

Loading…
Cancel
Save