diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-04-08 13:58:56 +0300 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-04-15 13:32:38 +0530 |
commit | f489aa77e54bb6ed508e81478cd5c71218a981aa (patch) | |
tree | 0a1b53d88720330fc8b8bc2a0765550641b71f4d | |
parent | 648e1303c4aacc0a7113dc2ce08c47f9166ad9e1 (diff) | |
download | meson-f489aa77e54bb6ed508e81478cd5c71218a981aa.zip meson-f489aa77e54bb6ed508e81478cd5c71218a981aa.tar.gz meson-f489aa77e54bb6ed508e81478cd5c71218a981aa.tar.bz2 |
Added documentation [skip ci]
-rw-r--r-- | docs/markdown/Reference-manual.md | 6 | ||||
-rw-r--r-- | docs/markdown/snippets/find-override.md | 27 |
2 files changed, 33 insertions, 0 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index da4c92b..57b1ae0 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -1396,6 +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`. + - `project_version()` returns the version string specified in `project` function call. - `project_license()` returns the array of licenses specified in `project` function call. diff --git a/docs/markdown/snippets/find-override.md b/docs/markdown/snippets/find-override.md new file mode 100644 index 0000000..dd8fe9b --- /dev/null +++ b/docs/markdown/snippets/find-override.md @@ -0,0 +1,27 @@ +## Can override find_program + +It is now possible to override the result of `find_program` to point +to a custom program you want. The overriding is global and applies to +every subproject from there on. Here is how you would use it. + +In master project + +```meson +subproject('mydep') +``` + +In the called subproject: + +```meson +prog = find_program('my_custom_script') +meson.override_find_program('mycodegen', prog) +``` + +In master project (or, in fact, any subproject): + +```meson +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. |