doc: Small tweaks to fallback documentation [skip ci]

pull/7433/head
Xavier Claessens 5 years ago committed by Jussi Pakkanen
parent 7ab0090d2a
commit f1edb83bb6
  1. 2
      docs/markdown/Reference-manual.md
  2. 6
      docs/markdown/Wrap-dependency-system-manual.md

@ -461,6 +461,8 @@ arguments:
and subproject registered the dependency using and subproject registered the dependency using
`meson.override_dependency('dependency_name', subproj_dep)`, or when the wrap `meson.override_dependency('dependency_name', subproj_dep)`, or when the wrap
file has `dependency_name` in its `[provide]` section. file has `dependency_name` in its `[provide]` section.
See [Wrap documentation](Wrap-dependency-system-manual.md#provide-section)
for more details.
- `language` *(since 0.42.0)*: defines what language-specific - `language` *(since 0.42.0)*: defines what language-specific
dependency to find if it's available for multiple languages. dependency to find if it's available for multiple languages.
- `method`: defines the way the dependency is detected, the default is - `method`: defines the way the dependency is detected, the default is

@ -147,7 +147,7 @@ wrap-git.
Wrap files can define the dependencies it provides in the `[provide]` section. Wrap files can define the dependencies it provides in the `[provide]` section.
``` ```ini
[provide] [provide]
dependency_names = foo-1.0 dependency_names = foo-1.0
``` ```
@ -162,7 +162,8 @@ where `foo_opt` is a feature option set to `auto`, will not fallback to the
subproject defined in the wrap file, for 2 reasons: subproject defined in the wrap file, for 2 reasons:
- It allows for looking the dependency in other ways first, for example using - It allows for looking the dependency in other ways first, for example using
`cc.find_library('foo')`, and only fallback if that fails: `cc.find_library('foo')`, and only fallback if that fails:
```
```meson
# this won't use fallback defined in foo.wrap # this won't use fallback defined in foo.wrap
foo_dep = dependency('foo-1.0', required: false) foo_dep = dependency('foo-1.0', required: false)
if not foo_dep.found() if not foo_dep.found()
@ -175,6 +176,7 @@ if not foo_dep.found()
endif endif
endif endif
``` ```
- Sometimes not-found dependency is preferable to a fallback when the feature is - Sometimes not-found dependency is preferable to a fallback when the feature is
not explicitly requested by the user. In that case not explicitly requested by the user. In that case
`dependency('foo-1.0', required: get_option('foo_opt'))` will only fallback `dependency('foo-1.0', required: get_option('foo_opt'))` will only fallback

Loading…
Cancel
Save