aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r--mesonbuild/backend/backends.py3
-rw-r--r--mesonbuild/backend/ninjabackend.py5
2 files changed, 6 insertions, 2 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index e49793e..a77047b 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -23,6 +23,7 @@ import subprocess
from ..mesonlib import MesonException, get_meson_script
from ..mesonlib import get_compiler_for_source, classify_unity_sources
from ..compilers import CompilerArgs
+from collections import OrderedDict
class CleanTrees:
'''
@@ -574,7 +575,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/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index dfb5600..98a2110 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -2351,7 +2351,10 @@ rule FORTRAN_DEP_HACK
cmds = []
for (k, v) in self.environment.coredata.user_options.items():
cmds.append('-D' + k + '=' + (v.value if isinstance(v.value, str) else str(v.value).lower()))
- return cmds
+ # The order of these arguments must be the same between runs of Meson
+ # to ensure reproducible output. The order we pass them shouldn't
+ # affect behaviour in any other way.
+ return sorted(cmds)
# For things like scan-build and other helper tools we might have.
def generate_utils(self, outfile):