modules/pkgconfig: Fix code to handle CustomTarget and CustomTargetIndex

pull/10718/head
Dylan Baker 3 years ago committed by Eli Schwartz
parent 2fb0c0e4d8
commit 9bd3c1957d
  1. 7
      mesonbuild/modules/pkgconfig.py

@ -297,16 +297,17 @@ class DependenciesHelper:
def remove_dups(self) -> None:
# Set of ids that have already been handled and should not be added any more
exclude: T.Set[build.Target] = set()
exclude: T.Set[str] = set()
# We can't just check if 'x' is excluded because we could have copies of
# the same SharedLibrary object for example.
def _ids(x: T.Union[str, build.CustomTarget, build.CustomTargetIndex, build.StaticLibrary]) -> T.Iterable[str]:
if isinstance(x, build.Target):
if isinstance(x, str):
yield x
else:
if x.get_id() in self.metadata:
yield self.metadata[x.get_id()].display_name
yield x.get_id()
yield x
# Exclude 'x' in all its forms and return if it was already excluded
def _add_exclude(x: T.Union[str, build.CustomTarget, build.CustomTargetIndex, build.StaticLibrary]) -> bool:

Loading…
Cancel
Save