Debian Codegraph @

subprojects/meson-docs/docs/yaml/functions/run_command.yaml

raw
1 name: run_command
2 returns: runresult
3 description: |
4 Runs the command specified in positional arguments. `command` can be a
5 string, or the output of [[find_program]],
6 [[files]] or [[configure_file]], or [a
7 compiler object](#compiler-object).
8
9 Returns a [[@runresult]] object containing the result
10 of the invocation. The command is run from an *unspecified* directory,
11 and Meson will set three environment variables `MESON_SOURCE_ROOT`,
12 `MESON_BUILD_ROOT` and `MESON_SUBDIR` that specify the source
13 directory, build directory and subdirectory the target was defined in,
14 respectively.
15
16 See also [External commands](External-commands.md).
17
18 varargs:
19 name: command
20 type: str | file | external_program | compiler
21 description: The command to execute during the setup process.
22
23 kwargs:
24 check:
25 type: bool
26 since: 0.47.0
27 default: false
28 description: |
29 If `true`, the exit status code of the command will be checked,
30 and the configuration will fail if it is non-zero. Note that
31 the default value will be `true` in future releases.
32
33 capture:
34 type: bool
35 since: 0.47.0
36 default: true
37 description: |
38 If `true`, any output generated on stdout will be captured and returned by
39 the `.stdout()` method. If it is false, then `.stdout()` will return an
40 empty string.
41
42 env:
43 type: env | list[str] | dict[str]
44 since: 0.50.0
45 description: |
46 environment variables to set,
47 such as `['NAME1=value1', 'NAME2=value2']`,
48 or an [[@env]] object which allows more sophisticated
49 environment juggling. *(Since 0.52.0)* A dictionary is also accepted.