diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2021-04-19 13:47:32 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-04-26 17:04:57 +0100 |
commit | 3af39a463b6d6314136bc944022a99c22bd31b04 (patch) | |
tree | 8c6902f7c39404aa913bf317280a3d8680c2375e /docs | |
parent | b6d277c140c7cbec3349bf5bd5986fc79f804e42 (diff) | |
download | meson-3af39a463b6d6314136bc944022a99c22bd31b04.zip meson-3af39a463b6d6314136bc944022a99c22bd31b04.tar.gz meson-3af39a463b6d6314136bc944022a99c22bd31b04.tar.bz2 |
Interpreter: Fallback when required is false but forcefallback is true
Diffstat (limited to 'docs')
-rw-r--r-- | docs/markdown/Wrap-dependency-system-manual.md | 3 | ||||
-rw-r--r-- | docs/markdown/snippets/forcefallback.md | 21 |
2 files changed, 24 insertions, 0 deletions
diff --git a/docs/markdown/Wrap-dependency-system-manual.md b/docs/markdown/Wrap-dependency-system-manual.md index ff092e8..eb5de1b 100644 --- a/docs/markdown/Wrap-dependency-system-manual.md +++ b/docs/markdown/Wrap-dependency-system-manual.md @@ -189,6 +189,9 @@ endif `dependency('foo-1.0', required: get_option('foo_opt'))` will only fallback when the user sets `foo_opt` to `enabled` instead of `auto`. +*Since 0.58.0* optional dependency like above will 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. If it is desired to fallback for an optional dependency, the `fallback` or `allow_fallback` keyword arguments must be passed diff --git a/docs/markdown/snippets/forcefallback.md b/docs/markdown/snippets/forcefallback.md new file mode 100644 index 0000000..7af5d39 --- /dev/null +++ b/docs/markdown/snippets/forcefallback.md @@ -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 +``` |