aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-08-10 11:36:42 -0700
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-08-20 18:57:19 +0200
commitc9e827a6a187bed146cb76d1dd398739d27dd183 (patch)
tree05c05e45a3938dd9a8036b05f12c40bafef4eeda
parentd754ee1a7fb2c0d82ed0fe33ebe7c0c6571f79d3 (diff)
downloadmeson-c9e827a6a187bed146cb76d1dd398739d27dd183.zip
meson-c9e827a6a187bed146cb76d1dd398739d27dd183.tar.gz
meson-c9e827a6a187bed146cb76d1dd398739d27dd183.tar.bz2
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.
-rw-r--r--mesonbuild/build.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index afe8526..9cba677 100644
--- a/mesonbuild/build.py
+++ b/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))