diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-09-07 23:14:14 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-09-07 23:14:14 +0300 |
commit | d26ab47072906d7a28a8843617487e601b56dfb2 (patch) | |
tree | 10298646ea42b45a000b85d0f8bf560607dd373c | |
parent | 9235fd4ec1cfdea9f1c73719c80607ee0cdad39b (diff) | |
download | meson-d26ab47072906d7a28a8843617487e601b56dfb2.zip meson-d26ab47072906d7a28a8843617487e601b56dfb2.tar.gz meson-d26ab47072906d7a28a8843617487e601b56dfb2.tar.bz2 |
Can use custom targets as executables to run in a run_target.
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 3 | ||||
-rw-r--r-- | test cases/common/58 run target/meson.build | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index adf9b71..481b800 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -448,6 +448,9 @@ int dummy; cmd.append(abs_exe) elif isinstance(texe, dependencies.ExternalProgram): cmd += texe.get_command() + elif isinstance(texe, build.CustomTarget): + deps.append(self.get_target_filename(texe)) + cmd += [os.path.join(self.environment.get_build_dir(), self.get_target_filename(texe))] else: cmd.append(target.command) cmd += arg_strings diff --git a/test cases/common/58 run target/meson.build b/test cases/common/58 run target/meson.build index 0ef1966..0ab41b3 100644 --- a/test cases/common/58 run target/meson.build +++ b/test cases/common/58 run target/meson.build @@ -37,3 +37,9 @@ run_target('py3hi', run_target('ct_in_arg', command : ['echo', hex, files('helloprinter.c')]) + +# What if the output of a custom_target is the command to +# execute. Obviously this will not work as hex is not an +# executable but test that the output is generated correctly. +run_target('donotrunme', + command : [hex]) |