Document that override_find_program works on configure_file [skip ci]

Also link to the release notes snippet from the Reference manual
pull/3218/head
Nirbheek Chauhan 7 years ago
parent f489aa77e5
commit 0e6a332d0c
  1. 11
      docs/markdown/Reference-manual.md
  2. 10
      docs/markdown/snippets/find-override.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.

@ -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)
```

Loading…
Cancel
Save