Index: tools/gn/scheduler.cc |
diff --git a/tools/gn/scheduler.cc b/tools/gn/scheduler.cc |
index dfc877d190bc1522f6f035432c8f6469fd4e2af0..a711df1cf02b41ed43cfff7b1bc1e5eaccc67da5 100644 |
--- a/tools/gn/scheduler.cc |
+++ b/tools/gn/scheduler.cc |
@@ -12,6 +12,7 @@ |
#include "build/build_config.h" |
#include "tools/gn/standard_out.h" |
#include "tools/gn/switches.h" |
+#include "tools/gn/target.h" |
#if defined(OS_WIN) |
#include <windows.h> |
@@ -153,6 +154,28 @@ void Scheduler::AddUnknownGeneratedInput(const Target* target, |
unknown_generated_inputs_.insert(std::make_pair(file, target)); |
} |
+void Scheduler::AddWriteRuntimeDepsTarget(const Target* target) { |
+ base::AutoLock lock(lock_); |
+ write_runtime_deps_targets_.push_back(target); |
+} |
+ |
+std::vector<const Target*> Scheduler::GetWriteRuntimeDepsTargets() const { |
+ base::AutoLock lock(lock_); |
+ return write_runtime_deps_targets_; |
+} |
+ |
+bool Scheduler::IsFileGeneratedByWriteRuntimeDeps( |
+ const OutputFile& file) const { |
+ base::AutoLock lock(lock_); |
+ // Number of targets should be quite small, so brute-force search is fine. |
+ for (const Target* target : write_runtime_deps_targets_) { |
+ if (file == target->write_runtime_deps_output()) { |
+ return true; |
+ } |
+ } |
+ return false; |
+} |
+ |
std::multimap<SourceFile, const Target*> |
Scheduler::GetUnknownGeneratedInputs() const { |
base::AutoLock lock(lock_); |