aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Creating-releases.md18
-rw-r--r--docs/markdown/Machine-files.md2
-rw-r--r--docs/markdown/Reference-manual.md31
-rw-r--r--docs/markdown/Syntax.md2
-rw-r--r--docs/markdown/snippets/customtarget_env.md11
-rw-r--r--docs/markdown/snippets/dist_subproject.md16
-rw-r--r--docs/markdown/snippets/pass_file_to_add_script.md15
-rw-r--r--docs/markdown/snippets/test_timeout.md9
-rw-r--r--docs/markdown/snippets/versionfile.md12
9 files changed, 109 insertions, 7 deletions
diff --git a/docs/markdown/Creating-releases.md b/docs/markdown/Creating-releases.md
index 040fb53..55242a6 100644
--- a/docs/markdown/Creating-releases.md
+++ b/docs/markdown/Creating-releases.md
@@ -58,3 +58,21 @@ for example when done in CI that already does its own testing.
So with `--no-tests` you can tell Meson "Do not build and test generated
packages.".
+## Release a subproject separately
+
+*Since 0.57.0* the `meson dist` command can now create a distribution tarball
+for a subproject in the same git repository as the main project. This can be
+useful if parts of the project (e.g. libraries) can be built and distributed
+separately. In that case they can be moved into `subprojects/mysub` and running
+`meson dist` in that directory will now create a tarball containing only the
+source code from that subdir and not the rest of the main project or other
+subprojects.
+
+For example:
+```sh
+git clone https://github.com/myproject
+cd myproject/subprojects/mysubproject
+meson builddir
+meson dist -C builddir
+```
+This produces `builddir/meson-dist/mysubproject-1.0.tar.xz` tarball.
diff --git a/docs/markdown/Machine-files.md b/docs/markdown/Machine-files.md
index e703988..e553720 100644
--- a/docs/markdown/Machine-files.md
+++ b/docs/markdown/Machine-files.md
@@ -34,7 +34,7 @@ A boolean must be either `true` or `false`, and unquoted.
option = false
```
-An integer must be either an unquoted numeric constant;
+An integer must be an unquoted numeric constant.
```ini
option = 42
```
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index cb8347a..3a844da 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -119,7 +119,9 @@ the following:
environment juggling. *(since 0.52.0)* A dictionary is also accepted.
- `exe_wrapper`: a list containing the wrapper command or script followed by the arguments to it
- `gdb`: if `true`, the tests are also run under `gdb`
-- `timeout_multiplier`: a number to multiply the test timeout with
+- `timeout_multiplier`: a number to multiply the test timeout with.
+ *Since 0.57* if timeout_multiplier is `<= 0` the test has infinite duration,
+ in previous versions of Meson the test would fail with a timeout immediately.
- `is_default` *(since 0.49.0)*: a bool to set whether this is the default test setup.
If `true`, the setup will be used whenever `meson test` is run
without the `--setup` option.
@@ -372,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:
@@ -1426,7 +1432,9 @@ Project supports the following keyword arguments.
- `version`: which is a free form string describing the version of
this project. You can access the value in your Meson build files
- with `meson.project_version()`.
+ with `meson.project_version()`. Since 0.57.0 this can also be a
+ `File` object pointing to a file that contains exactly one line of
+ text.
### run_command()
@@ -1730,7 +1738,8 @@ test(..., env: nomalloc, ...)
- `timeout`: the amount of seconds the test is allowed to run, a test
that exceeds its time limit is always considered failed, defaults to
- 30 seconds
+ 30 seconds. *Since 0.57* if timeout is `<= 0` the test has infinite duration,
+ in previous versions of Meson the test would fail with a timeout immediately.
- `workdir`: absolute path that will be used as the working directory
for the test
@@ -1817,21 +1826,29 @@ the following methods.
it from a subproject is a hard error. *(since 0.49.0)* Accepts multiple arguments
for the fscript. *(since 0.54.0)* The `MESON_SOURCE_ROOT` and `MESON_BUILD_ROOT`
environment variables are set when dist scripts are run.
+
*(since 0.55.0)* The output of `configure_file`, `files`, and `find_program`
as well as strings.
+ *(since 0.57.0)* `file` objects and the output of `configure_file` may be
+ *used as the `script_name` parameter.
+
- `add_install_script(script_name, arg1, arg2, ...)`: causes the script
given as an argument to be run during the install step, this script
will have the environment variables `MESON_SOURCE_ROOT`,
`MESON_BUILD_ROOT`, `MESON_INSTALL_PREFIX`,
`MESON_INSTALL_DESTDIR_PREFIX`, and `MESONINTROSPECT` set.
All positional arguments are passed as parameters.
+
+ *(since 0.54.0)* If `meson install` is called with the `--quiet` option, the
+ environment variable `MESON_INSTALL_QUIET` will be set.
+
*(since 0.55.0)* The output of `configure_file`, `files`, `find_program`,
`custom_target`, indexes of `custom_target`, `executable`, `library`, and
other built targets as well as strings.
- *(since 0.54.0)* If `meson install` is called with the `--quiet` option, the
- environment variable `MESON_INSTALL_QUIET` will be set.
+ *(since 0.57.0)* `file` objects and the output of `configure_file` may be
+ *used as the `script_name` parameter.
Meson uses the `DESTDIR` environment variable as set by the
inherited environment to determine the (temporary) installation
@@ -1859,9 +1876,13 @@ the following methods.
executable given as an argument after all project files have been
generated. This script will have the environment variables
`MESON_SOURCE_ROOT` and `MESON_BUILD_ROOT` set.
+
*(since 0.55.0)* The output of `configure_file`, `files`, and `find_program`
as well as strings.
+ *(since 0.57.0)* `file` objects and the output of `configure_file` may be
+ *used as the `script_name` parameter.
+
- `backend()` *(since 0.37.0)*: returns a string representing the
current backend: `ninja`, `vs2010`, `vs2015`, `vs2017`, `vs2019`,
or `xcode`.
diff --git a/docs/markdown/Syntax.md b/docs/markdown/Syntax.md
index 65cb70f..4f17ac8 100644
--- a/docs/markdown/Syntax.md
+++ b/docs/markdown/Syntax.md
@@ -657,7 +657,7 @@ equality_expression: relational_expression | (equality_expression equality_opera
equality_operator: "==" | "!="
expression: assignment_expression
expression_list: expression ("," expression)*
-expression_statememt: expression
+expression_statement: expression
function_expression: id_expression "(" [argument_list] ")"
hex_literal: "0x" HEX_NUMBER
HEX_NUMBER: /[a-fA-F0-9]+/
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'])
+```
diff --git a/docs/markdown/snippets/dist_subproject.md b/docs/markdown/snippets/dist_subproject.md
new file mode 100644
index 0000000..2520ccd
--- /dev/null
+++ b/docs/markdown/snippets/dist_subproject.md
@@ -0,0 +1,16 @@
+## Package a subproject
+
+The `meson dist` command can now create a distribution tarball for a subproject
+in the same git repository as the main project. This can be useful if parts of
+the project (e.g. libraries) can be built and distributed separately. In that
+case they can be moved into `subprojects/mysub` and running `meson dist` in that
+directory will now create a tarball containing only the source code from that
+subdir and not the rest of the main project or other subprojects.
+
+For example:
+```sh
+git clone https://github.com/myproject
+cd myproject/subprojects/mysubproject
+meson builddir
+meson dist -C builddir
+```
diff --git a/docs/markdown/snippets/pass_file_to_add_script.md b/docs/markdown/snippets/pass_file_to_add_script.md
new file mode 100644
index 0000000..10d08e0
--- /dev/null
+++ b/docs/markdown/snippets/pass_file_to_add_script.md
@@ -0,0 +1,15 @@
+## The `add_*_script` methods now accept a File as the first argument
+
+Meson now accepts `file` objects, including those produced by
+`configure_file` as the `prog` (first) parameter of the various
+`add_*_script` methods
+
+```meson
+install_script = configure_file(
+ configuration : conf,
+ input : 'myscript.py.in',
+ output : 'myscript.py',
+)
+
+meson.add_install_script(install_script, other, params)
+```
diff --git a/docs/markdown/snippets/test_timeout.md b/docs/markdown/snippets/test_timeout.md
new file mode 100644
index 0000000..e436d2e
--- /dev/null
+++ b/docs/markdown/snippets/test_timeout.md
@@ -0,0 +1,9 @@
+## `test()` timeout and timeout_multiplier value <= 0
+
+`test(..., timeout: 0)`, or negative value, used to abort the test immediately
+but now instead allow infinite duration. Note that omitting the `timeout`
+keyword argument still defaults to 30s timeout.
+
+Likewise, `add_test_setup(..., timeout_multiplier: 0)`, or
+`meson test --timeout-multiplier 0`, or negative value, disable tests timeout.
+
diff --git a/docs/markdown/snippets/versionfile.md b/docs/markdown/snippets/versionfile.md
new file mode 100644
index 0000000..6071f2c
--- /dev/null
+++ b/docs/markdown/snippets/versionfile.md
@@ -0,0 +1,12 @@
+## Project version can be specified with a file
+
+Meson can be instructed to load project's version string from an
+external file like this:
+
+```meson
+project('foo', 'c' version: files('VERSION'))
+```
+
+The version file must contain exactly one line of text and that will
+be set as the project's version. If the line ends in a newline
+character, it is removed.