Skip to content

Commit

Permalink
Added documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpakkane committed Apr 8, 2018
1 parent 9b8ffce commit 59a361c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/markdown/Reference-manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,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.
Expand Down
27 changes: 27 additions & 0 deletions docs/markdown/snippets/find-override.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 59a361c

Please sign in to comment.