diff options
Diffstat (limited to 'docs/markdown')
-rw-r--r-- | docs/markdown/Reference-manual.md | 4 | ||||
-rw-r--r-- | docs/markdown/snippets/customtarget_env.md | 11 |
2 files changed, 15 insertions, 0 deletions
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']) +``` |