From 633264984b4b2278491476a0997193ff4996b3a6 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 21 Jan 2021 13:12:21 -0500 Subject: custom_target: Add env kwarg --- docs/markdown/Reference-manual.md | 4 ++++ docs/markdown/snippets/customtarget_env.md | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100644 docs/markdown/snippets/customtarget_env.md (limited to 'docs/markdown') diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 4a1e759..f758e71 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -374,6 +374,10 @@ following. - `install_mode` *(since 0.47.0)*: the file mode and optionally the owner/uid and group/gid - `output`: list of output files +- `env` *(since 0.57.0)*: environment variables to set, such as + `{'NAME1': 'value1', 'NAME2': 'value2'}` or `['NAME1=value1', 'NAME2=value2']`, + or an [`environment()` object](#environment-object) which allows more + sophisticated environment juggling. The list of strings passed to the `command` keyword argument accept the following special string substitutions: diff --git a/docs/markdown/snippets/customtarget_env.md b/docs/markdown/snippets/customtarget_env.md new file mode 100644 index 0000000..93687ab --- /dev/null +++ b/docs/markdown/snippets/customtarget_env.md @@ -0,0 +1,11 @@ +## custom_target() now accepts `env` keyword argument + +Environment variables can now be passed to `custom_target()` command. + +```meson +env = environment() +env.append('PATH', '/foo') +custom_target(..., env: env) +custom_target(..., env: {'MY_ENV': 'value'}) +custom_target(..., env: ['MY_ENV=value']) +``` -- cgit v1.1