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

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: 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/pointer_set_unittest.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..5dfd06479dbf9a87a645cad03caea4d344eb0a0c 100644
--- a/tools/gn/target.cc
+++ b/tools/gn/target.cc
@@ -10,6 +10,7 @@
#include "tools/gn/config_values_extractors.h"
#include "tools/gn/deps_iterator.h"
#include "tools/gn/filesystem_utils.h"
+#include "tools/gn/pointer_set.h"
#include "tools/gn/scheduler.h"
#include "tools/gn/substitution_writer.h"
#include "tools/gn/trace.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 {
mithro-old 2015/12/03 05:20:31 I'm unsure if we want an implicit less than operat
Zachary Forman 2015/12/03 07:27:02 Acknowledged. I'll leave this for the GN develope
+ return label() < other.label();
+}
« tools/gn/pointer_set_unittest.cc ('K') | « tools/gn/target.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698