diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-05-20 00:59:20 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-05-20 23:38:13 +0300 |
commit | 79d530e32509b8ccdc50a6769e8c786b3eccebd3 (patch) | |
tree | 49f6efe74cbccf3de19a208f163e228824f7f12b /docs/markdown | |
parent | 60e1676651a0ba1b5a1ff6e6ed443421f878b8e2 (diff) | |
download | meson-79d530e32509b8ccdc50a6769e8c786b3eccebd3.zip meson-79d530e32509b8ccdc50a6769e8c786b3eccebd3.tar.gz meson-79d530e32509b8ccdc50a6769e8c786b3eccebd3.tar.bz2 |
Generators can have extra target dependencies. Closes #4131.
Diffstat (limited to 'docs/markdown')
-rw-r--r-- | docs/markdown/Reference-manual.md | 3 | ||||
-rw-r--r-- | docs/markdown/snippets/gendeps.md | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 01fa3c3..2fc3d6a 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -714,6 +714,9 @@ following: - `arguments` a list of template strings that will be the command line arguments passed to the executable +- `depends` is an array of build targets that must be built before this + generator can be run. This is used if you have a generator that calls + a second executable that is built in this project. Available since 0.51.0 - `depfile` is a template string pointing to a dependency file that a generator can write listing all the additional files this target depends on, for example a C compiler would list all the header files diff --git a/docs/markdown/snippets/gendeps.md b/docs/markdown/snippets/gendeps.md new file mode 100644 index 0000000..e724994 --- /dev/null +++ b/docs/markdown/snippets/gendeps.md @@ -0,0 +1,16 @@ +## Generators have a new `depends` keyword argument + +Generators can now specify extra dependencies with the `depends` +keyword argument. It matches the behaviour of the same argument in +other functions and specifies that the given targets must be built +before the generator can be run. This is used in cases such as this +one where you need to tell a generator to indirectly invoke a +different program. + +```meson +exe = executable(...) +cg = generator(program_runner, + output: ['@BASENAME@.c'], + arguments: ['--use-tool=' + exe.full_path(), '@INPUT@', '@OUTPUT@'], + depends: exe) +``` |