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

Unified Diff: tools/gn/target_generator.cc

Issue 1804303004: 🚙 GN: Add write_runtime_deps variable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove {}s Created 4 years, 9 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/target_generator.h ('k') | tools/gn/target_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/target_generator.cc
diff --git a/tools/gn/target_generator.cc b/tools/gn/target_generator.cc
index f5b4ec8122f9305de54bf846b1ffce3142d0d88e..4a84bcd5cd28ce450d06ea9f92940b6a9e6fd858 100644
--- a/tools/gn/target_generator.cc
+++ b/tools/gn/target_generator.cc
@@ -58,6 +58,9 @@ void TargetGenerator::Run() {
if (!Visibility::FillItemVisibility(target_, scope_, err_))
return;
+ if (!FillWriteRuntimeDeps())
+ return;
+
// Do type-specific generation.
DoRun();
}
@@ -383,3 +386,23 @@ bool TargetGenerator::FillGenericDeps(const char* var_name,
}
return !err_->has_error();
}
+
+bool TargetGenerator::FillWriteRuntimeDeps() {
+ const Value* value = scope_->GetValue(variables::kWriteRuntimeDeps, true);
+ if (!value)
+ return true;
+
+ // Compute the file name and make sure it's in the output dir.
+ SourceFile source_file = scope_->GetSourceDir().ResolveRelativeFile(
+ *value, err_, GetBuildSettings()->root_path_utf8());
+ if (err_->has_error())
+ return false;
+ if (!EnsureStringIsInOutputDir(GetBuildSettings()->build_dir(),
+ source_file.value(), value->origin(), err_))
+ return false;
+ OutputFile output_file(GetBuildSettings(), source_file);
+ target_->set_write_runtime_deps_output(output_file);
+
+ g_scheduler->AddWriteRuntimeDepsTarget(target_);
+ return true;
+}
« no previous file with comments | « tools/gn/target_generator.h ('k') | tools/gn/target_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698