diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2017-04-25 07:56:49 +1000 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-05-11 00:13:30 +0300 |
commit | 7ed19902be3f866ff599822b56cea5a34ec661d1 (patch) | |
tree | 85f4adc5e085a105ac81f9280ef47d6c85ebaf3f /docs/markdown | |
parent | 1aa68cf6e3b05b63bf858aa005c34aeea362e3f9 (diff) | |
download | meson-7ed19902be3f866ff599822b56cea5a34ec661d1.zip meson-7ed19902be3f866ff599822b56cea5a34ec661d1.tar.gz meson-7ed19902be3f866ff599822b56cea5a34ec661d1.tar.bz2 |
pkgconfig: add suppport for custom variables during generation
Usage:
pkgconfig.generate(
...
description : 'A library with custom variables.',
variables : ['foo=bar', 'datadir=${prefix}/data']
)
The variables 'prefix', 'libdir' and 'includedir' are reserved, meson will
fail with an error message.
Variables can reference each other with the pkgconfig notation, e.g.
variables : ['datadir=${prefix}/data',
'otherdatadir=${datadir}/other']
meson does not check this for correctness or that the referenced variable
exists, we merely keep the same order as specified.
Diffstat (limited to 'docs/markdown')
-rw-r--r-- | docs/markdown/Pkgconfig-module.md | 1 | ||||
-rw-r--r-- | docs/markdown/Release-notes-for-0.41.0.md | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/docs/markdown/Pkgconfig-module.md b/docs/markdown/Pkgconfig-module.md index 51fe6b2..6b9a968 100644 --- a/docs/markdown/Pkgconfig-module.md +++ b/docs/markdown/Pkgconfig-module.md @@ -20,3 +20,4 @@ The generated file's properties are specified with the following keyword argumen - `requires_private` list of strings to put in the `Requires.private` field - `libraries_private` list of strings to put in the `Libraries.private` field - `install_dir` the directory to install to, defaults to the value of option `libdir` followed by `/pkgconfig` +- `variables` a list of strings with custom variables to add to the generated file. The strings must be in the form `name=value` and may reference other pkgconfig variables, e.g. `datadir=${prefix}/share`. The names `prefix`, `libdir` and `installdir` are reserved and may not be used. diff --git a/docs/markdown/Release-notes-for-0.41.0.md b/docs/markdown/Release-notes-for-0.41.0.md index a2a64de..8a7f263 100644 --- a/docs/markdown/Release-notes-for-0.41.0.md +++ b/docs/markdown/Release-notes-for-0.41.0.md @@ -24,3 +24,17 @@ The ninja backend now quotes special characters that may be interpreted by ninja itself, providing better interoperability with custom commands. This support may not be perfect; please report any issues found with special characters to the issue tracker. + +## Pkgconfig support for custom variables + +The Pkgconfig module object can add arbitrary variables to the generated .pc +file with the new `variables` keyword: +```meson +pkg.generate(libraries : libs, + subdirs : h, + version : '1.0', + name : 'libsimple', + filebase : 'simple', + description : 'A simple demo library.', + variables : ['datadir=${prefix}/data']) +``` |