diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2019-11-25 14:29:05 -0500 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2020-03-06 15:26:02 -0500 |
commit | 943e9368f7198b6c2b069ad024ee798037f3c35e (patch) | |
tree | afaae1242cb0d6a17cdd6e16cffd92611a2e80b4 /docs/markdown | |
parent | 2fdedc4d0fc73c509669bf9f89863017e0f0989b (diff) | |
download | meson-943e9368f7198b6c2b069ad024ee798037f3c35e.zip meson-943e9368f7198b6c2b069ad024ee798037f3c35e.tar.gz meson-943e9368f7198b6c2b069ad024ee798037f3c35e.tar.bz2 |
Simplify dependency() fallback
Now that subprojects can override the dependency name, there is no need
to provide a variable name for the fallback any more.
Diffstat (limited to 'docs/markdown')
-rw-r--r-- | docs/markdown/Reference-manual.md | 4 | ||||
-rw-r--r-- | docs/markdown/snippets/override_dependency.md | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 09d54be..b4d2333 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -445,6 +445,10 @@ arguments: [`dependency()`](#dependency), etc. Note that this means the fallback dependency may be a not-found dependency, in which case the value of the `required:` kwarg will be obeyed. + *Since 0.54.0* `'subproj_dep'` argument can be omitted in the case the + subproject used `meson.override_dependency('dependency_name', subproj_dep)`. + In that case, the `fallback` keyword argument can be a single string instead + of a list of 2 strings. - `language` *(added 0.42.0)* defines what language-specific dependency to find if it's available for multiple languages. - `method` defines the way the dependency is detected, the default is diff --git a/docs/markdown/snippets/override_dependency.md b/docs/markdown/snippets/override_dependency.md index 875eef8..ca420bc 100644 --- a/docs/markdown/snippets/override_dependency.md +++ b/docs/markdown/snippets/override_dependency.md @@ -57,3 +57,9 @@ If the subproject does `dependency('foo')` but the main project wants to provide its own implementation of `foo`, it can for example call `meson.override_dependency('foo', declare_dependency(...))` before configuring the subproject. + +## Simplified `dependency()` fallback + +In the case a subproject `foo` calls `meson.override_dependency('foo-2.0', foo_dep)`, +the parent project can omit the dependency variable name in fallback keyword +argument: `dependency('foo-2.0', fallback : 'foo')`. |