Index: tools/gn/ninja_target_writer.cc |
diff --git a/tools/gn/ninja_target_writer.cc b/tools/gn/ninja_target_writer.cc |
index 6be8c966fa5af7516b6e173fc50abd39a252cb2d..1b5a8deb602a3f2023d00e3ff7bcc9b525fafb01 100644 |
--- a/tools/gn/ninja_target_writer.cc |
+++ b/tools/gn/ninja_target_writer.cc |
@@ -84,12 +84,14 @@ void NinjaTargetWriter::RunAndWriteFile(const Target* target, |
static_cast<int>(contents.size())); |
} |
-std::string NinjaTargetWriter::WriteInputDepsStampAndGetDep() const { |
+std::string NinjaTargetWriter::WriteInputDepsStampAndGetDep( |
+ const std::vector<const Target*>& extra_hard_deps) const { |
// For an action (where we run a script only once) the sources are the same |
// as the source prereqs. |
bool list_sources_as_input_deps = target_->output_type() == Target::ACTION; |
- if (target_->source_prereqs().empty() && |
+ if (extra_hard_deps.empty() && |
+ target_->source_prereqs().empty() && |
target_->recursive_hard_deps().empty() && |
(!list_sources_as_input_deps || target_->sources().empty())) |
return std::string(); // No input/hard deps. |
@@ -133,6 +135,13 @@ std::string NinjaTargetWriter::WriteInputDepsStampAndGetDep() const { |
path_output_.WriteFile(out_, helper_.GetTargetOutputFile(*i)); |
} |
+ // Extra hard deps passed in. |
+ for (size_t i = 0; i < extra_hard_deps.size(); i++) { |
+ out_ << " "; |
+ path_output_.WriteFile(out_, |
+ helper_.GetTargetOutputFile(extra_hard_deps[i])); |
+ } |
+ |
out_ << "\n"; |
return " | " + stamp_file_string; |
} |