aboutsummaryrefslogtreecommitdiff
path: root/dep.cc
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2015-10-01 16:07:48 -0700
committerDan Willemsen <dwillemsen@google.com>2015-10-01 16:12:36 -0700
commitb248caabf20589d5f5a3adbb1e88d2c286eaa466 (patch)
treee9f5a355e9f41e8a3bbc49e7e110419bfae46f19 /dep.cc
parenta62b02a1251a0f6c452a25fce03258f12472507f (diff)
Use ordered containers to prevent changes to ninja files
When using --gen_all_targets / --gen_all_phony_targets, we're changing the selected targets using unordered containers. This causes trivial changes to the makefiles to trigger large changes to the generated ninja files. Switch to using ordered containers so that the order is the same every time.
Diffstat (limited to 'dep.cc')
-rw-r--r--dep.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/dep.cc b/dep.cc
index 6f4fc11..1ed2f68 100644
--- a/dep.cc
+++ b/dep.cc
@@ -18,7 +18,9 @@
#include <algorithm>
#include <iterator>
+#include <map>
#include <memory>
+#include <set>
#include <unordered_map>
#include <unordered_set>
@@ -524,7 +526,7 @@ class DepBuilder {
}
Evaluator* ev_;
- unordered_map<Symbol, shared_ptr<Rule>> rules_;
+ map<Symbol, shared_ptr<Rule>> rules_;
const unordered_map<Symbol, Vars*>& rule_vars_;
unique_ptr<Vars> cur_rule_vars_;
@@ -534,7 +536,7 @@ class DepBuilder {
shared_ptr<Rule> first_rule_;
unordered_map<Symbol, DepNode*> done_;
- unordered_set<Symbol> phony_;
+ set<Symbol> phony_;
};
void MakeDep(Evaluator* ev,