Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: tools/gn/target.cc

Issue 1494883002: GN: Makes GN output deterministic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moves sort into ninja_toolchain_writer.cc for consistency Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« tools/gn/ninja_toolchain_writer.cc ('K') | « tools/gn/target.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/target.cc
diff --git a/tools/gn/target.cc b/tools/gn/target.cc
index 4a93abc240cd36655d24a9ec8e0a9d52749e8543..e6a14c6e4d67200ad7f328e3b6eff5f299ab516f 100644
--- a/tools/gn/target.cc
+++ b/tools/gn/target.cc
@@ -9,6 +9,7 @@
#include "base/strings/stringprintf.h"
#include "tools/gn/config_values_extractors.h"
#include "tools/gn/deps_iterator.h"
+#include "tools/gn/dereference_comparator.h"
#include "tools/gn/filesystem_utils.h"
#include "tools/gn/scheduler.h"
#include "tools/gn/substitution_writer.h"
@@ -70,7 +71,7 @@ Err MakeStaticLibDepsError(const Target* from, const Target* to) {
bool EnsureFileIsGeneratedByDependency(const Target* target,
const OutputFile& file,
bool check_private_deps,
- std::set<const Target*>* seen_targets) {
+ PointerSet<const Target>* seen_targets) {
if (seen_targets->find(target) != seen_targets->end())
return false; // Already checked this one and it's not found.
seen_targets->insert(target);
@@ -548,7 +549,11 @@ void Target::CheckSourceGenerated(const SourceFile& source) const {
// the list of files written by the GN build itself (often response files)
// can be filtered out of this list.
OutputFile out_file(settings()->build_settings(), source);
- std::set<const Target*> seen_targets;
+ PointerSet<const Target> seen_targets;
if (!EnsureFileIsGeneratedByDependency(this, out_file, true, &seen_targets))
g_scheduler->AddUnknownGeneratedInput(this, source);
}
+
+bool Target::operator<(const Target& other) const {
+ return label() < other.label();
+}
« tools/gn/ninja_toolchain_writer.cc ('K') | « tools/gn/target.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698