diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2020-04-13 18:12:43 -0400 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2020-07-01 09:51:57 -0400 |
commit | 71804e56eb3612eabc51887fe4d46961684a3ecc (patch) | |
tree | ecc5fecb9e2493db6fb60feda4c1c8d317e4b07c /docs/markdown/Wrap-dependency-system-manual.md | |
parent | 2a7f72885ff0623a0a625efb5ffeca6299fc4cf7 (diff) | |
download | meson-71804e56eb3612eabc51887fe4d46961684a3ecc.zip meson-71804e56eb3612eabc51887fe4d46961684a3ecc.tar.gz meson-71804e56eb3612eabc51887fe4d46961684a3ecc.tar.bz2 |
wrap: Add special 'dependency_names' key in [provide] section
The value for that key must be a coma separated list of dependecy names
provided by that subproject, when no variable name is needed because the
subproject uses override_dependency().
Diffstat (limited to 'docs/markdown/Wrap-dependency-system-manual.md')
-rw-r--r-- | docs/markdown/Wrap-dependency-system-manual.md | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/docs/markdown/Wrap-dependency-system-manual.md b/docs/markdown/Wrap-dependency-system-manual.md index cb7c6d6..b927944 100644 --- a/docs/markdown/Wrap-dependency-system-manual.md +++ b/docs/markdown/Wrap-dependency-system-manual.md @@ -145,12 +145,15 @@ wrap-git, the repository must contain all Meson build definitions. Wrap files can define the dependencies it provides in the `[provide]` section. When a wrap file provides the dependency `foo` any call do `dependency('foo')` will automatically fallback to that subproject even if no `fallback` keyword -argument is given. Each entry in the format `dependency_name = variable_name`, +argument is given. It is recommended for subprojects to call +`meson.override_dependency('foo', foo_dep)`, dependency name can then be added into +the special `dependency_names` entry which takes coma separated list of dependency +names. For backward compatibility with subprojects that does not call +`meson.override_dependency()`, the variable name can be provided in the wrap file +with entries in the format `dependency_name = variable_name`, where `dependency_name` usually match the corresponding pkg-config name and `variable_name` is the name of a variable defined in the subproject that should -be returned for that dependency. In the case the subproject uses -`meson.override_dependency('foo', foo_dep)` the `variable_name` can be left empty -in the wrap file. +be returned for that dependency. For example `glib.wrap` provides `glib-2.0`, `gobject-2.0` and `gio-2.0`. A wrap file for glib would look like: @@ -165,6 +168,17 @@ gobject-2.0=gobject_dep gio-2.0=gio_dep ``` +Alternatively, when using a recent enough version of glib that uses +`meson.override_dependency()`: +```ini +[wrap-git] +url=https://gitlab.gnome.org/GNOME/glib.git +revision=glib-2-62 + +[provide] +dependency_names = glib-2.0, gobject-2.0, gio-2.0 +``` + With such wrap file, `dependency('glib-2.0')` will automatically fallback to use `glib.wrap` and return `glib_dep` variable from the subproject. |