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

Unified Diff: tools/gn/ninja_target_writer.cc

Issue 265703008: Support deps for actions in GN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months 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
« no previous file with comments | « tools/gn/ninja_target_writer.h ('k') | tools/gn/ninja_target_writer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « tools/gn/ninja_target_writer.h ('k') | tools/gn/ninja_target_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698