run_command()
Runs the command specified in positional arguments. command can be a
string, or the output of find_program(),
files() or configure_file(), or a
compiler object.
Returns a runresult object containing the result
of the invocation. The command is run from an unspecified directory,
and Meson will set three environment variables MESON_SOURCE_ROOT,
MESON_BUILD_ROOT and MESON_SUBDIR that specify the source
directory, build directory and subdirectory the target was defined in,
respectively.
See also External commands.
Signature
# Runs the command specified in positional arguments
runresult run_command(
str | file | external_program command..., # The command to execute during the setup process
# Keyword arguments:
capture : bool # If `true`, any output generated on stdout will be captured and returned by
check : bool # If `true`, the exit status code of the command will be checked,
env : env | array[str] | dict[str] # environment variables to set,
)
Arguments
The
function accepts between 0 and infinity variadic
arguments (command...) of type .str | file | external_program
The command to execute during the setup process.
The function run_command()
accepts the following keyword arguments:
| Name | Type | Description | Tags |
|---|---|---|---|
capture |
bool |
If |
(since 0.47.0)
|
check |
bool |
If |
(since 0.47.0)
|
env |
env | array[str] | dict[str] |
environment variables to set,
such as |
(since 0.50.0) |
The results of the search are