aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets/forcefallback.md
blob: 7af5d39ed113453834e170f464a76dae0729286a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
## Use fallback from wrap file when force fallback

Optional dependency like below will now fallback to the subproject
defined in the wrap file in the case `wrap_mode` is set to `forcefallback`
or `force_fallback_for` contains the subproject.

```meson
# required is false because we could fallback to cc.find_library(), but in the
# forcefallback case this now configure the subproject.
dep = dependency('foo-1.0', required: false)
if not dep.found()
  dep = cc.find_library('foo', has_headers: 'foo.h')
endif
```

```ini
[wrap-file]
...
[provide]
dependency_names = foo-1.0
```