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

Side by Side Diff: tools/gn/toolchain.cc

Issue 2006923004: Add support for user defined "pool" to GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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 unified diff | Download patch
« tools/gn/functions.cc ('K') | « tools/gn/toolchain.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tools/gn/toolchain.h" 5 #include "tools/gn/toolchain.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string.h> 8 #include <string.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 case TYPE_STAMP: return kToolStamp; 79 case TYPE_STAMP: return kToolStamp;
80 case TYPE_COPY: return kToolCopy; 80 case TYPE_COPY: return kToolCopy;
81 case TYPE_COPY_BUNDLE_DATA: return kToolCopyBundleData; 81 case TYPE_COPY_BUNDLE_DATA: return kToolCopyBundleData;
82 case TYPE_COMPILE_XCASSETS: return kToolCompileXCAssets; 82 case TYPE_COMPILE_XCASSETS: return kToolCompileXCAssets;
83 default: 83 default:
84 NOTREACHED(); 84 NOTREACHED();
85 return std::string(); 85 return std::string();
86 } 86 }
87 } 87 }
88 88
89 Tool* Toolchain::GetTool(ToolType type) {
90 DCHECK(type != TYPE_NONE);
91 return tools_[static_cast<size_t>(type)].get();
92 }
93
89 const Tool* Toolchain::GetTool(ToolType type) const { 94 const Tool* Toolchain::GetTool(ToolType type) const {
90 DCHECK(type != TYPE_NONE); 95 DCHECK(type != TYPE_NONE);
91 return tools_[static_cast<size_t>(type)].get(); 96 return tools_[static_cast<size_t>(type)].get();
92 } 97 }
93 98
94 void Toolchain::SetTool(ToolType type, std::unique_ptr<Tool> t) { 99 void Toolchain::SetTool(ToolType type, std::unique_ptr<Tool> t) {
95 DCHECK(type != TYPE_NONE); 100 DCHECK(type != TYPE_NONE);
96 DCHECK(!tools_[type].get()); 101 DCHECK(!tools_[type].get());
97 t->SetComplete(); 102 t->SetComplete();
98 tools_[type] = std::move(t); 103 tools_[type] = std::move(t);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 return TYPE_STAMP; 170 return TYPE_STAMP;
166 default: 171 default:
167 NOTREACHED(); 172 NOTREACHED();
168 return Toolchain::TYPE_NONE; 173 return Toolchain::TYPE_NONE;
169 } 174 }
170 } 175 }
171 176
172 const Tool* Toolchain::GetToolForTargetFinalOutput(const Target* target) const { 177 const Tool* Toolchain::GetToolForTargetFinalOutput(const Target* target) const {
173 return tools_[GetToolTypeForTargetFinalOutput(target)].get(); 178 return tools_[GetToolTypeForTargetFinalOutput(target)].get();
174 } 179 }
OLDNEW
« tools/gn/functions.cc ('K') | « tools/gn/toolchain.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698