aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/backend/backends.py3
-rw-r--r--mesonbuild/build.py15
2 files changed, 14 insertions, 4 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 99be172..e37b0df 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -22,6 +22,7 @@ import json
import subprocess
from ..mesonlib import MesonException, get_compiler_for_source, classify_unity_sources
from ..compilers import CompilerArgs
+from collections import OrderedDict
class CleanTrees:
'''
@@ -542,7 +543,7 @@ class Backend:
return newargs
def get_build_by_default_targets(self):
- result = {}
+ result = OrderedDict()
# Get all build and custom targets that must be built by default
for name, t in self.build.get_targets().items():
if t.build_by_default or t.install or t.build_always:
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index ce5638d..ed0abc4 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -82,9 +82,9 @@ class Build:
self.project_version = None
self.environment = environment
self.projects = {}
- self.targets = {}
- self.compilers = {}
- self.cross_compilers = {}
+ self.targets = OrderedDict()
+ self.compilers = OrderedDict()
+ self.cross_compilers = OrderedDict()
self.global_args = {}
self.projects_args = {}
self.global_link_args = {}
@@ -326,6 +326,9 @@ class BuildTarget(Target):
self.validate_sources()
self.validate_cross_install(environment)
+ 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)
@@ -1257,6 +1260,9 @@ class CustomTarget(Target):
mlog.warning('Unknown keyword arguments in target %s: %s' %
(self.name, ', '.join(unknowns)))
+ 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)
@@ -1417,6 +1423,9 @@ 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)