diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/markdown/Generating-sources.md | 2 | ||||
-rw-r--r-- | docs/markdown/Reference-manual.md | 14 | ||||
-rw-r--r-- | docs/markdown/Release-notes-for-0.43.0/001-generator-capture.md | 4 | ||||
-rw-r--r-- | docs/markdown/snippets/custom-target-index.md | 21 |
4 files changed, 37 insertions, 4 deletions
diff --git a/docs/markdown/Generating-sources.md b/docs/markdown/Generating-sources.md index c251805..c5e338d 100644 --- a/docs/markdown/Generating-sources.md +++ b/docs/markdown/Generating-sources.md @@ -31,7 +31,7 @@ gen_src = custom_target('gen-output', '--h-out', '@OUTPUT1@']) ``` -The `@INPUT@` there will be transformed to `'out.c' 'out.h'`. Just like the output, you can also refer to each input file individually by index. +The `@INPUT@` there will be transformed to `'somefile1.c' 'file2.c'`. Just like the output, you can also refer to each input file individually by index. Then you just put that in your program and you're done. diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index f3640f0..f37fb34 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -554,6 +554,9 @@ following: - `output` a template string (or list of template strings) defining how an output file name is (or multiple output names are) generated from a single source file name +- `capture` when this argument is set to true, Meson captures `stdout` + of the `executable` and writes it to the target file specified as + `output`. Available since v0.43.0. The returned object also has methods that are documented in the [object methods section](#generator-object) below. @@ -1309,9 +1312,9 @@ the following methods: - `get_id()` returns a string identifying the compiler. For example, `gcc`, `msvc`, [and more](Compiler-properties.md#compiler-id). -- `get_supported_arguments(list_of_string)` returns an array - containing only the arguments supported by the compiler, as if - `has_argument` were called on them individually. +- `get_supported_arguments(list_of_string)` *(added 0.43.0)* returns + an array containing only the arguments supported by the compiler, + as if `has_argument` were called on them individually. - `has_argument(argument_name)` returns true if the compiler accepts the specified command line argument, that is, can compile code @@ -1567,6 +1570,11 @@ contains a target with the following methods: this and will also allow Meson to setup inter-target dependencies correctly. Please file a bug if that doesn't work for you. +- `[index]` returns an opaque object that references this target, and can be + used as a source in other targets. When it is used as such it will make that + target depend on this custom target, but the only source added will be the + one that corresponds to the index of the custom target's output argument. + ### `dependency` object This object is returned by [`dependency()`](#dependency) and contains diff --git a/docs/markdown/Release-notes-for-0.43.0/001-generator-capture.md b/docs/markdown/Release-notes-for-0.43.0/001-generator-capture.md new file mode 100644 index 0000000..4eb7fc0 --- /dev/null +++ b/docs/markdown/Release-notes-for-0.43.0/001-generator-capture.md @@ -0,0 +1,4 @@ +## Generator learned capture + +Generators can now be configured to capture the standard output. See +`test cases/common/98 gen extra/meson.build` for an example. diff --git a/docs/markdown/snippets/custom-target-index.md b/docs/markdown/snippets/custom-target-index.md new file mode 100644 index 0000000..10d7cf1 --- /dev/null +++ b/docs/markdown/snippets/custom-target-index.md @@ -0,0 +1,21 @@ +# Can index CustomTaget objects + +The `CustomTarget` object can now be indexed like an array. The resulting +object can be used as a source file for other Targets, this will create a +dependency on the original `CustomTarget`, but will only insert the generated +file corresponding to the index value of the `CustomTarget`'s `output` keyword. + + c = CustomTarget( + ... + output : ['out.h', 'out.c'], + ) + lib1 = static_library( + 'lib1', + [lib1_sources, c[0]], + ... + ) + exec = executable( + 'executable', + c[1], + link_with : lib1, + ) |