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

Unified Diff: tools/gn/builder.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/builder.cc
diff --git a/tools/gn/builder.cc b/tools/gn/builder.cc
index bb3f834f6cb21970950f89cae1ae2821832e7556..16dab6eca1f1ddd395e32599a6ce4ac6586d3d77 100644
--- a/tools/gn/builder.cc
+++ b/tools/gn/builder.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <utility>
+#include "tools/gn/action_values.h"
#include "tools/gn/config.h"
#include "tools/gn/deps_iterator.h"
#include "tools/gn/err.h"
@@ -439,6 +440,7 @@ bool Builder::ResolveItem(BuilderRecord* record, Err* err) {
!ResolveConfigs(&target->configs(), err) ||
!ResolveConfigs(&target->all_dependent_configs(), err) ||
!ResolveConfigs(&target->public_configs(), err) ||
+ !ResolveActionValues(&target->action_values(), err) ||
!ResolveToolchain(target, err))
return false;
} else if (record->type() == BuilderRecord::ITEM_CONFIG) {
@@ -519,6 +521,20 @@ bool Builder::ResolveToolchain(Target* target, Err* err) {
return true;
}
+bool Builder::ResolveActionValues(ActionValues* action_values, Err* err) {
+ if (action_values->pool().label.is_null())
+ return true;
+
+ BuilderRecord* record = GetResolvedRecordOfType(
+ action_values->pool().label, action_values->pool().origin,
+ BuilderRecord::ITEM_POOL, err);
+ if (!record)
+ return false;
+ action_values->set_pool(LabelPtrPair<Pool>(record->item()->AsPool()));
+
+ return true;
+}
+
bool Builder::ResolvePools(Toolchain* toolchain, Err* err) {
for (int i = Toolchain::TYPE_NONE + 1; i < Toolchain::TYPE_NUMTYPES; i++) {
Toolchain::ToolType tool_type = static_cast<Toolchain::ToolType>(i);

Powered by Google App Engine
This is Rietveld 408576698