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

Unified Diff: tools/gn/function_write_file.cc

Issue 1222693002: Add ninja dependency reference to gen written files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« build/toolchain/cros/BUILD.gn ('K') | « build/toolchain/cros/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/function_write_file.cc
diff --git a/tools/gn/function_write_file.cc b/tools/gn/function_write_file.cc
index 45387a3967555394005d7455117160379055f25c..767bee78fa238e39d4a99be2551b59f6bb3de42e 100644
--- a/tools/gn/function_write_file.cc
+++ b/tools/gn/function_write_file.cc
@@ -114,6 +114,11 @@ Value RunWriteFile(Scope* scope,
source_file.value(), args[0].origin(), err))
return Value();
g_scheduler->AddWrittenFile(source_file); // Track that we wrote this file.
+ // Track how to recreate this file, since we write it a gen time.
+ // Note this is a hack since the correct output is not a dependency proper,
+ // but an addition of this file to the output of the gn rule that writes it.
+ g_scheduler->AddGenDependency(
+ scope->settings()->build_settings()->GetFullPath(source_file));
// Compute output.
std::ostringstream contents;
« build/toolchain/cros/BUILD.gn ('K') | « build/toolchain/cros/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698