aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/build.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index b5e431b..5fb92e2 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -355,6 +355,18 @@ a hard error in the future.''' % name)
if not hasattr(self, 'typename'):
raise RuntimeError('Target type is not set for target class "{}". This is a bug'.format(type(self).__name__))
+ def __lt__(self, other: object) -> bool:
+ return self.get_id() < other.get_id()
+
+ def __le__(self, other: object) -> bool:
+ return self.get_id() <= other.get_id()
+
+ def __gt__(self, other: object) -> bool:
+ return self.get_id() > other.get_id()
+
+ def __ge__(self, other: object) -> bool:
+ return self.get_id() >= other.get_id()
+
def get_install_dir(self, environment):
# Find the installation directory.
default_install_dir = self.get_default_install_dir(environment)
@@ -488,9 +500,6 @@ class BuildTarget(Target):
self.validate_install(environment)
self.check_module_linking()
- def __lt__(self, other):
- return self.get_id() < other.get_id()
-
def __repr__(self):
repr_str = "<{0} {1}: {2}>"
return repr_str.format(self.__class__.__name__, self.get_id(), self.filename)
@@ -2005,9 +2014,6 @@ class CustomTarget(Target):
def get_default_install_dir(self, environment):
return None
- def __lt__(self, other):
- return self.get_id() < other.get_id()
-
def __repr__(self):
repr_str = "<{0} {1}: {2}>"
return repr_str.format(self.__class__.__name__, self.get_id(), self.command)
@@ -2245,9 +2251,6 @@ class RunTarget(Target):
self.args = args
self.dependencies = dependencies
- def __lt__(self, other):
- return self.get_id() < other.get_id()
-
def __repr__(self):
repr_str = "<{0} {1}: {2}>"
return repr_str.format(self.__class__.__name__, self.get_id(), self.command)