aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-01-26 10:32:33 -0800
committerJussi Pakkanen <jpakkane@gmail.com>2021-01-27 21:59:55 +0000
commitf808c955eab983b31feee130f0947c7cb254a94f (patch)
treeb6d71a5288d7cadec4fa1ea1c7782873731ae1c3 /docs/markdown
parent633264984b4b2278491476a0997193ff4996b3a6 (diff)
downloadmeson-f808c955eab983b31feee130f0947c7cb254a94f.zip
meson-f808c955eab983b31feee130f0947c7cb254a94f.tar.gz
meson-f808c955eab983b31feee130f0947c7cb254a94f.tar.bz2
intepreter: Allow using file objects for the script_name of add_*_script
It's a bit silly and conveluted to have to call find_program on the output of configure_file, so let's just allow passing files as the script name.
Diffstat (limited to 'docs/markdown')
-rw-r--r--docs/markdown/Reference-manual.md16
-rw-r--r--docs/markdown/snippets/pass_file_to_add_script.md15
2 files changed, 29 insertions, 2 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index f758e71..3970d6d 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -1824,21 +1824,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
@@ -1866,9 +1874,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/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)
+```