aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
Diffstat (limited to 'docs/markdown/snippets')
-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
5 files changed, 63 insertions, 0 deletions
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.