Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/markdown/Pkgconfig-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ keyword arguments.
`${PREFIX}/include/foobar-1`, the correct value for this argument
would be `foobar-1`
- `requires` list of strings, pkgconfig-dependencies or libraries that
`pkgconfig.generate()` was used on to put in the `Requires` field
`pkgconfig.generate()` was used on to put in the `Requires` field.
*Since 1.9.0* internal dependencies are supported if `pkgconfig.generate()`
was used on the underlying library.
- `requires_private` the same as `requires` but for the `Requires.private` field
- `url` a string with a url for the library
- `license` (*Since 1.9.0*) a string with a SPDX license to add to the generated file.
Expand Down
5 changes: 5 additions & 0 deletions docs/markdown/Release-notes-for-1.9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ section of .editorconfig based on the parsed file name.

When specified, it will add a `License:` attribute to the generated .pc file.

## pkgconfig.generate supports internal dependencies in `requires`

Internal dependencies can now be specified to `requires` if
pkgconfig.generate was called on the underlying library.

## New experimental option `rust_dynamic_std`

A new option `rust_dynamic_std` can be used to link Rust programs so
Expand Down
8 changes: 6 additions & 2 deletions mesonbuild/modules/pkgconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ def _process_reqs(self, reqs: T.Sequence[T.Union[str, build.StaticLibrary, build
elif isinstance(obj, dependencies.ExternalDependency) and obj.name == 'threads':
pass
elif isinstance(obj, dependencies.InternalDependency) and all(lib.get_id() in self.metadata for lib in obj.libraries):
FeatureNew.single_use('pkgconfig.generate requirement from internal dependency', '1.9.0',
self.state.subproject, location=self.state.current_node)
# Ensure BothLibraries are resolved:
if self.pub_libs and isinstance(self.pub_libs[0], build.StaticLibrary):
obj = obj.get_as_static(recursive=True)
Expand All @@ -166,8 +168,10 @@ def _process_reqs(self, reqs: T.Sequence[T.Union[str, build.StaticLibrary, build
processed_reqs.append(self.metadata[lib.get_id()].filebase)
else:
raise mesonlib.MesonException('requires argument not a string, '
'library with pkgconfig-generated file '
f'or pkgconfig-dependency object, got {obj!r}')
'library with pkgconfig-generated file, '
'pkgconfig-dependency object, or '
'internal-dependency object with '
f'pkgconfig-generated file, got {obj!r}')
return processed_reqs

def add_cflags(self, cflags: T.List[str]) -> None:
Expand Down
Loading