From bcf369ea3c6ac9d48759a9a11304a853dfdab5ff Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 15 Oct 2020 09:56:08 -0400 Subject: Fix consistency in variables kwarg Share common code to extract the `variables` kwarg in declare_dependency() and pkg.generate(). --- docs/markdown/snippets/pkg_idep_variables.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/markdown/snippets/pkg_idep_variables.md (limited to 'docs/markdown/snippets') diff --git a/docs/markdown/snippets/pkg_idep_variables.md b/docs/markdown/snippets/pkg_idep_variables.md new file mode 100644 index 0000000..4e69b18 --- /dev/null +++ b/docs/markdown/snippets/pkg_idep_variables.md @@ -0,0 +1,12 @@ +## Consistency between `declare_dependency()` and `pkgconfig.generate()` variables + +The `variables` keyword argument in `declare_dependency()` used to only support +dictionary and `pkgconfig.generate()` only list of strings. They now both support +dictionary and list of strings in the format `'name=value'`. This makes easier +to share a common set of variables for both: + +```meson +vars = {'foo': 'bar'} +dep = declare_dependency(..., variables: vars) +pkg.generate(..., variables: vars) +``` -- cgit v1.1