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

Unified Diff: tools/gn/action_target_generator.cc

Issue 2926013002: Support explicit pools in actions (Closed)
Patch Set: Created 3 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
Index: tools/gn/action_target_generator.cc
diff --git a/tools/gn/action_target_generator.cc b/tools/gn/action_target_generator.cc
index 5c7cbf67a8de2093676daea83feccdd8b38d6016..d48e5a9e02ff9c514ddfc7cd0bdbb023bbe020e2 100644
--- a/tools/gn/action_target_generator.cc
+++ b/tools/gn/action_target_generator.cc
@@ -7,6 +7,7 @@
#include "tools/gn/build_settings.h"
#include "tools/gn/err.h"
#include "tools/gn/filesystem_utils.h"
+#include "tools/gn/functions.h"
#include "tools/gn/parse_tree.h"
#include "tools/gn/scope.h"
#include "tools/gn/value.h"
@@ -57,7 +58,7 @@ void ActionTargetGenerator::DoRun() {
if (!FillDepfile())
return;
- if (!FillConsole())
+ if (!FillPool())
return;
if (!FillCheckIncludes())
@@ -160,13 +161,20 @@ bool ActionTargetGenerator::FillDepfile() {
return true;
}
-bool ActionTargetGenerator::FillConsole() {
- const Value* value = scope_->GetValue(variables::kConsole, true);
+bool ActionTargetGenerator::FillPool() {
+ const Value* value = scope_->GetValue(variables::kPool, true);
if (!value)
return true;
- if (!value->VerifyTypeIs(Value::BOOLEAN, err_))
+
+ Label label = Label::Resolve(scope_->GetSourceDir(),
+ ToolchainLabelForScope(scope_), *value, err_);
+ if (err_->has_error())
return false;
- target_->action_values().set_console(value->boolean_value());
+
+ LabelPtrPair<Pool> pair(label);
+ pair.origin = target_->defined_from();
+
+ target_->action_values().set_pool(std::move(pair));
return true;
}

Powered by Google App Engine
This is Rietveld 408576698