diff --git a/docs/markdown/Pkgconfig-module.md b/docs/markdown/Pkgconfig-module.md index 7e935247d..da1895771 100644 --- a/docs/markdown/Pkgconfig-module.md +++ b/docs/markdown/Pkgconfig-module.md @@ -51,7 +51,7 @@ keyword arguments. e.g. `datadir=${prefix}/share`. The names `prefix`, `libdir` and `installdir` are reserved and may not be used. - `version` a string describing the version of this library, used to set the - `Version:` field. Defaults to the project version if unspecified. + `Version:` field. (*since 0.46.0*) Defaults to the project version if unspecified. - `d_module_versions` a list of module version flags used when compiling D sources referred to by this pkg-config file diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index 8ce28bae8..2f8b53381 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -353,7 +353,9 @@ class PkgConfigModule(ExtensionModule): default_description = None default_name = None mainlib = None - if len(args) == 1: + if not args and 'version' not in kwargs: + FeatureNew('pkgconfig.generate implicit version keyword', '0.46.0').use(state.subproject) + elif len(args) == 1: FeatureNew('pkgconfig.generate optional positional argument', '0.46.0').use(state.subproject) mainlib = getattr(args[0], 'held_object', args[0]) if not isinstance(mainlib, (build.StaticLibrary, build.SharedLibrary)):