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; |