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

Unified Diff: tools/gn/script_target_generator.cc

Issue 55633002: GN: Add ability to specify a depfile for custom targets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: respond to comments Created 7 years, 1 month 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/script_target_generator.h ('k') | tools/gn/script_values.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/script_target_generator.cc
diff --git a/tools/gn/script_target_generator.cc b/tools/gn/script_target_generator.cc
index c9616950e4b48ce4ca90f2942e7f4e27b45eec24..272061c488be588e66ae98043c974c6ff80c323f 100644
--- a/tools/gn/script_target_generator.cc
+++ b/tools/gn/script_target_generator.cc
@@ -4,6 +4,7 @@
#include "tools/gn/script_target_generator.h"
+#include "tools/gn/build_settings.h"
#include "tools/gn/err.h"
#include "tools/gn/filesystem_utils.h"
#include "tools/gn/scope.h"
@@ -48,6 +49,10 @@ void ScriptTargetGenerator::DoRun() {
if (err_->has_error())
return;
+ FillDepfile();
+ if (err_->has_error())
+ return;
+
// Script outputs don't depend on the current toolchain so we can skip adding
// that dependency.
}
@@ -77,3 +82,12 @@ void ScriptTargetGenerator::FillScriptArgs() {
return;
target_->script_values().swap_in_args(&args);
}
+
+void ScriptTargetGenerator::FillDepfile() {
+ const Value* value = scope_->GetValue(variables::kDepfile, true);
+ if (!value)
+ return;
+ target_->script_values().set_depfile(
+ scope_->settings()->build_settings()->build_dir().ResolveRelativeFile(
+ value->string_value()));
+}
« no previous file with comments | « tools/gn/script_target_generator.h ('k') | tools/gn/script_values.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698