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

Unified Diff: tools/gn/ninja_helper.cc

Issue 51693002: GN: toolchain threading cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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/ninja_helper.h ('k') | tools/gn/ninja_helper_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/ninja_helper.cc
diff --git a/tools/gn/ninja_helper.cc b/tools/gn/ninja_helper.cc
index d90b698cd87b9a6c39add00d682a510658854c81..e872c2411248d8b51808450a57348483d2aa2d06 100644
--- a/tools/gn/ninja_helper.cc
+++ b/tools/gn/ninja_helper.cc
@@ -189,23 +189,20 @@ OutputFile NinjaHelper::GetTargetOutputFile(const Target* target) const {
return ret;
}
-std::string NinjaHelper::GetRulePrefix(const Toolchain* toolchain) const {
- // This code doesn't prefix the default toolchain commands. This is disabled
- // so we can coexist with GYP's commands (which aren't prefixed). If we don't
- // need to coexist with GYP anymore, we can uncomment this to make things a
- // bit prettier.
- //if (toolchain->is_default())
- // return std::string(); // Default toolchain has no prefix.
- return toolchain->label().name() + "_";
+std::string NinjaHelper::GetRulePrefix(const Settings* settings) const {
+ // Don't prefix the default toolchain so it looks prettier, prefix everything
+ // else.
+ if (settings->is_default())
+ return std::string(); // Default toolchain has no prefix.
+ return settings->toolchain_label().name() + "_";
}
std::string NinjaHelper::GetRuleForSourceType(const Settings* settings,
- const Toolchain* toolchain,
SourceFileType type) const {
// This function may be hot since it will be called for every source file
// in the tree. We could cache the results to avoid making a string for
// every invocation.
- std::string prefix = GetRulePrefix(toolchain);
+ std::string prefix = GetRulePrefix(settings);
if (type == SOURCE_C)
return prefix + "cc";
« no previous file with comments | « tools/gn/ninja_helper.h ('k') | tools/gn/ninja_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698