aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-04-11 21:44:20 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2018-04-15 13:32:38 +0530
commit0e6a332d0cf8538c5f62a3def646c477c0d772b5 (patch)
tree87564ad8813451aeb87da0d69cc9f4ffc4305d22
parentf489aa77e54bb6ed508e81478cd5c71218a981aa (diff)
downloadmeson-0e6a332d0cf8538c5f62a3def646c477c0d772b5.zip
meson-0e6a332d0cf8538c5f62a3def646c477c0d772b5.tar.gz
meson-0e6a332d0cf8538c5f62a3def646c477c0d772b5.tar.bz2
Document that override_find_program works on configure_file [skip ci]
Also link to the release notes snippet from the Reference manual
-rw-r--r--docs/markdown/Reference-manual.md11
-rw-r--r--docs/markdown/snippets/find-override.md10
2 files changed, 16 insertions, 5 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index 57b1ae0..fad6a3c 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -1396,11 +1396,12 @@ the following methods.
/path/to/meson.py introspect`. The user is responsible for splitting
the string to an array if needed.
-- `override_find_program(progname, program)` specifies that whenever
- `find_program` is used to find a program named `progname`, Meson
- should not not look it up on the system but instead return
- `program`, which may either be the result of `find_program` or
- `configure_file`.
+- `override_find_program(progname, program)` [*(Added
+ 0.46.0)*](Release-notes-for-0-46-0.html#Can-override-find_program)
+ specifies that whenever `find_program` is used to find a program
+ named `progname`, Meson should not not look it up on the system but
+ instead return `program`, which may either be the result of
+ `find_program` or `configure_file`.
- `project_version()` returns the version string specified in `project` function call.
diff --git a/docs/markdown/snippets/find-override.md b/docs/markdown/snippets/find-override.md
index dd8fe9b..ef3a4a2 100644
--- a/docs/markdown/snippets/find-override.md
+++ b/docs/markdown/snippets/find-override.md
@@ -25,3 +25,13 @@ genprog = find_program('mycodegen')
Now `genprog` points to the custom script. If the dependency had come
from the system, then it would point to the system version.
+
+You can also use the return value of `configure_file()` to override
+a program in the same way as above:
+
+```meson
+prog_script = configure_file(input : 'script.sh.in',
+ output : 'script.sh',
+ configuration : cdata)
+meson.override_find_program('mycodegen', prog_script)
+```