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.
This commit is contained in:
parent
d754ee1a7f
commit
c9e827a6a1
|
@ -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…
Reference in New Issue