aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorSam Thursfield <sam@afuera.me.uk>2017-04-01 20:04:53 +0100
committerSam Thursfield <sam@afuera.me.uk>2017-04-03 17:02:41 +0100
commitf5b7cfdbf0888fb99956cf2dc661c519aa08a9a4 (patch)
tree4f8f1e7c8d0a2798dd3c8c6e1360e2fb25d73328 /mesonbuild/backend/backends.py
parentc7f66c3a9e4f69e0bcde8819f15c9d8b972a2f75 (diff)
downloadmeson-f5b7cfdbf0888fb99956cf2dc661c519aa08a9a4.zip
meson-f5b7cfdbf0888fb99956cf2dc661c519aa08a9a4.tar.gz
meson-f5b7cfdbf0888fb99956cf2dc661c519aa08a9a4.tar.bz2
Ensure rules in the generated build.ninja file are in a stable order
Previously, two functionally identical builds could produce different build.ninja files. The ordering of the rules themselves doesn't affect behaviour, but unnecessary changes in commandline arguments can cause spurious rebuilds and if the ordering of the overall file is stable than it's easy to use `diff` to compare different build.ninja files and spot the differences in ordering that are triggering the unnecessary rebuilds.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py3
1 files changed, 2 insertions, 1 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: