aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/markdown/Pkgconfig-module.md2
-rw-r--r--mesonbuild/modules/pkgconfig.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/docs/markdown/Pkgconfig-module.md b/docs/markdown/Pkgconfig-module.md
index 7e93524..da18957 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 8ce28ba..2f8b533 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)):