parent
b6d277c140
commit
3af39a463b
6 changed files with 51 additions and 8 deletions
@ -0,0 +1,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 |
||||
``` |
@ -0,0 +1,8 @@ |
||||
project('implicit force fallback') |
||||
|
||||
# The dependency 'something' is provided by a subproject. Normally this won't |
||||
# use the fallback subproject because required is false. However this unit test |
||||
# is configured with wrap_mode=forcefallback and force_fallback_for=something |
||||
# in which case we are expecting the fallback to be done. |
||||
d = dependency('something', required: false) |
||||
assert(d.found()) |
@ -0,0 +1,3 @@ |
||||
project('something') |
||||
|
||||
meson.override_dependency('something', declare_dependency()) |
Loading…
Reference in new issue