build: Add a `name` property to CustomTargetIndex

This is needed to make CustomTargetIndex polymorphic with Target derived
classes, and is used in the build module.
pull/9143/head
Dylan Baker 3 years ago committed by Daniel Mensinger
parent d754ee1a7f
commit c9e827a6a1
  1. 4
      mesonbuild/build.py

@ -2573,6 +2573,10 @@ class CustomTargetIndex(HoldableObject):
self.output = output
self.for_machine = target.for_machine
@property
def name(self) -> str:
return f'{self.target.name}[{self.output}]'
def __repr__(self):
return '<CustomTargetIndex: {!r}[{}]>'.format(
self.target, self.target.get_outputs().index(self.output))

Loading…
Cancel
Save