From 522392e7553823e6b3ac38cadc4fbee72eae9540 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 4 Feb 2021 16:02:03 -0500 Subject: run_target: Add env kwarg Re-implement it in backend using the same code path as for custom_target(). This for example handle setting PATH on Windows when command is an executable. --- docs/markdown/Reference-manual.md | 4 ++++ docs/markdown/snippets/customtarget_env.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 14802eb..f623728 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -1504,6 +1504,10 @@ and subdirectory the target was defined in, respectively. - `depends` is a list of targets that this target depends on but which are not listed in the command array (because, for example, the script does file globbing internally) +- `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. ### set_variable() diff --git a/docs/markdown/snippets/customtarget_env.md b/docs/markdown/snippets/customtarget_env.md index 69bfc0d..f2d651b 100644 --- a/docs/markdown/snippets/customtarget_env.md +++ b/docs/markdown/snippets/customtarget_env.md @@ -1,4 +1,4 @@ -## `custom_target()` now accepts an `env` keyword argument +## `custom_target()` and `run_target()` now accepts an `env` keyword argument Environment variables can now be passed to the `custom_target()` command. -- cgit v1.1