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

Unified Diff: tools/gn/builder.cc

Issue 440333002: Support more configurability in GN toolchains (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unsigned check Created 6 years, 4 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/builder.h ('k') | tools/gn/builder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/builder.cc
diff --git a/tools/gn/builder.cc b/tools/gn/builder.cc
index d498b108e1bf02d9cc1198c1c676d66b68c2f463..dccc095a949c6658a8211110fa61c1ed2100f108 100644
--- a/tools/gn/builder.cc
+++ b/tools/gn/builder.cc
@@ -408,7 +408,8 @@ bool Builder::ResolveItem(BuilderRecord* record, Err* err) {
!ResolveConfigs(&target->configs(), err) ||
!ResolveConfigs(&target->all_dependent_configs(), err) ||
!ResolveConfigs(&target->direct_dependent_configs(), err) ||
- !ResolveForwardDependentConfigs(target, err))
+ !ResolveForwardDependentConfigs(target, err) ||
+ !ResolveToolchain(target, err))
return false;
} else if (record->type() == BuilderRecord::ITEM_TOOLCHAIN) {
Toolchain* toolchain = record->item()->AsToolchain();
@@ -499,6 +500,24 @@ bool Builder::ResolveForwardDependentConfigs(Target* target, Err* err) {
return true;
}
+bool Builder::ResolveToolchain(Target* target, Err* err) {
+ BuilderRecord* record = GetResolvedRecordOfType(
+ target->settings()->toolchain_label(), target->defined_from(),
+ BuilderRecord::ITEM_TOOLCHAIN, err);
+ if (!record) {
+ *err = Err(target->defined_from(),
+ "Toolchain for target not defined.",
+ "I was hoping to find a toolchain " +
+ target->settings()->toolchain_label().GetUserVisibleName(false));
+ return false;
+ }
+
+ if (!target->SetToolchain(record->item()->AsToolchain(), err))
+ return false;
+
+ return true;
+}
+
std::string Builder::CheckForCircularDependencies(
const std::vector<const BuilderRecord*>& bad_records) const {
std::vector<const BuilderRecord*> cycle;
« no previous file with comments | « tools/gn/builder.h ('k') | tools/gn/builder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698