From d2fa6d50809e6a5955999152f43a461595c6bc4c Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 2 Sep 2021 11:04:19 -0400 Subject: Make custom_target() name argument optional --- docs/markdown/Reference-manual.md | 16 ++++++++++++++-- docs/markdown/snippets/custom_target_name.md | 4 ++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 docs/markdown/snippets/custom_target_name.md (limited to 'docs') diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index b3dbf65..a91fa3e 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -326,8 +326,20 @@ false otherwise. ``` Create a custom top level build target. The only positional argument -is the name of this target and the keyword arguments are the -following. +is the name of this target and cannot contain path separators (`/` or `\`). +The name of custom target might not be used by every backends, for instance with +the Ninja backend, `subdir/meson.build` containing the example below, +`ninja -C builddir foo` or `ninja -C builddir subdir/foo` won't work, +it is instead `ninja -C builddir subdir/file.txt`. Howerver, `meson compile subdir/foo` +is accepted. +```meson +custom_target('foo', output: 'file.txt', ...) +``` + +*Since 0.60.0* the name argument is optional and defaults to the basename of the first +output (`file.txt` in the example above). + +These are all the supported keyword arguments: - `build_by_default` *(since 0.38.0)*: causes, when set to true, to have this target be built by default. This means it will be built when diff --git a/docs/markdown/snippets/custom_target_name.md b/docs/markdown/snippets/custom_target_name.md new file mode 100644 index 0000000..5ad136d --- /dev/null +++ b/docs/markdown/snippets/custom_target_name.md @@ -0,0 +1,4 @@ +## Optional `custom_target()` name + +The name argument is now optional and defaults to the basename of the first +output. \ No newline at end of file -- cgit v1.1