diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/markdown/External-commands.md | 8 | ||||
-rw-r--r-- | docs/markdown/Reference-manual.md | 6 | ||||
-rw-r--r-- | docs/markdown/i18n-module.md | 1 | ||||
-rw-r--r-- | docs/markdown/snippets/cuda.md | 7 | ||||
-rw-r--r-- | docs/markdown/snippets/introspect_breaking_format.md | 2 | ||||
-rw-r--r-- | docs/markdown/snippets/run_command_env.md | 9 |
6 files changed, 30 insertions, 3 deletions
diff --git a/docs/markdown/External-commands.md b/docs/markdown/External-commands.md index 9336ec3..4c8c8e4 100644 --- a/docs/markdown/External-commands.md +++ b/docs/markdown/External-commands.md @@ -16,6 +16,14 @@ output = r.stdout().strip() errortxt = r.stderr().strip() ``` +Additionally, since 0.50.0, you can pass the command [`environment`](Reference-manual.html#environment-object) object: + +```meson +env = environment() +env.set('FOO', 'bar') +run_command('command', 'arg1', 'arg2', env: env) +``` + The `run_command` function returns an object that can be queried for return value and text written to stdout and stderr. The `strip` method call is used to strip trailing and leading whitespace from diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index e913e25..db43813 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -1183,12 +1183,14 @@ and Meson will set three environment variables `MESON_SOURCE_ROOT`, directory, build directory and subdirectory the target was defined in, respectively. -This function has one keyword argument. +This function supports the following keyword arguments: - `check` takes a boolean. If `true`, the exit status code of the command will be checked, and the configuration will fail if it is non-zero. The default is `false`. Since 0.47.0 + - `env` an [environment object](#environment-object) to use a custom environment + Since 0.50.0 See also [External commands](External-commands.md). @@ -2175,7 +2177,7 @@ and has the following methods: This object is returned by [`environment()`](#environment) and stores detailed information about how environment variables should be set during tests. It should be passed as the `env` keyword argument to -tests. It has the following methods. +tests and other functions. It has the following methods. - `append(varname, value1, value2, ...)` appends the given values to the old value of the environment variable, e.g. `env.append('FOO', diff --git a/docs/markdown/i18n-module.md b/docs/markdown/i18n-module.md index 88f059b..9053edc 100644 --- a/docs/markdown/i18n-module.md +++ b/docs/markdown/i18n-module.md @@ -29,6 +29,7 @@ argument which is the name of the gettext module. [source](https://github.com/mesonbuild/meson/blob/master/mesonbuild/modules/i18n.py) for for their value * `install`: (*Added 0.43.0*) if false, do not install the built translations. +* `install_dir`: (*Added 0.50.0*) override default install location, default is `localedir` This function also defines targets for maintainers to use: **Note**: These output to the source directory diff --git a/docs/markdown/snippets/cuda.md b/docs/markdown/snippets/cuda.md new file mode 100644 index 0000000..a4a92cd --- /dev/null +++ b/docs/markdown/snippets/cuda.md @@ -0,0 +1,7 @@ +## Cuda support + +Compiling Cuda source code is now supported, though only with the +Ninja backend. This has been tested only on Linux for now. + +Because NVidia's Cuda compiler does not produce `.d` dependency files, +dependency tracking does not work. diff --git a/docs/markdown/snippets/introspect_breaking_format.md b/docs/markdown/snippets/introspect_breaking_format.md index c96c82c..a0fa29a 100644 --- a/docs/markdown/snippets/introspect_breaking_format.md +++ b/docs/markdown/snippets/introspect_breaking_format.md @@ -7,5 +7,5 @@ affects the `filename` key in the targets introspection and the output of Furthermore, the `filename` and `install_filename` keys in the targets introspection are now lists of strings with identical length. -The `--traget-files` option is now deprecated, since the same information +The `--target-files` option is now deprecated, since the same information can be acquired from the `--tragets` introspection API. diff --git a/docs/markdown/snippets/run_command_env.md b/docs/markdown/snippets/run_command_env.md new file mode 100644 index 0000000..dfa5ac5 --- /dev/null +++ b/docs/markdown/snippets/run_command_env.md @@ -0,0 +1,9 @@ +## `run_command` accepts `env` kwarg + +You can pass [`environment`](Reference-manual.html#environment-object) object to [`run_command`](Reference-manual.html#run-command), just like to `test`: + +```meson +env = environment() +env.set('FOO', 'bar') +run_command('command', 'arg1', 'arg2', env: env) +``` |