diff options
-rw-r--r-- | docs/markdown/Reference-manual.md | 11 | ||||
-rw-r--r-- | docs/markdown/snippets/find-override.md | 10 |
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) +``` |