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

Side by Side Diff: tools/gn/tool.h

Issue 2006923004: Add support for user defined "pool" to GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef TOOLS_GN_TOOL_H_ 5 #ifndef TOOLS_GN_TOOL_H_
6 #define TOOLS_GN_TOOL_H_ 6 #define TOOLS_GN_TOOL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "tools/gn/label.h"
13 #include "tools/gn/label_ptr.h"
12 #include "tools/gn/substitution_list.h" 14 #include "tools/gn/substitution_list.h"
13 #include "tools/gn/substitution_pattern.h" 15 #include "tools/gn/substitution_pattern.h"
14 16
17 class Pool;
18
15 class Tool { 19 class Tool {
16 public: 20 public:
17 enum DepsFormat { 21 enum DepsFormat {
18 DEPS_GCC = 0, 22 DEPS_GCC = 0,
19 DEPS_MSVC = 1 23 DEPS_MSVC = 1
20 }; 24 };
21 25
22 enum PrecompiledHeaderType { 26 enum PrecompiledHeaderType {
23 PCH_NONE = 0, 27 PCH_NONE = 0,
24 PCH_GCC = 1, 28 PCH_GCC = 1,
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 } 170 }
167 171
168 const SubstitutionPattern& rspfile_content() const { 172 const SubstitutionPattern& rspfile_content() const {
169 return rspfile_content_; 173 return rspfile_content_;
170 } 174 }
171 void set_rspfile_content(const SubstitutionPattern& content) { 175 void set_rspfile_content(const SubstitutionPattern& content) {
172 DCHECK(!complete_); 176 DCHECK(!complete_);
173 rspfile_content_ = content; 177 rspfile_content_ = content;
174 } 178 }
175 179
180 const LabelPtrPair<Pool> pool_label_pair() const { return pool_; }
brettw 2016/05/24 22:03:31 According to style I think this should be called p
sdefresne 2016/05/26 15:38:37 Done.
181 void set_pool_label_pair(const LabelPtrPair<Pool>& pool) { pool_ = pool; }
182
183 void set_pool(const Pool* pool) { pool_.ptr = pool; }
184
176 // Other functions ---------------------------------------------------------- 185 // Other functions ----------------------------------------------------------
177 186
178 // Called when the toolchain is saving this tool, after everything is filled 187 // Called when the toolchain is saving this tool, after everything is filled
179 // in. 188 // in.
180 void SetComplete(); 189 void SetComplete();
181 190
182 // Returns true if this tool has separate outputs for dependency tracking 191 // Returns true if this tool has separate outputs for dependency tracking
183 // and linking. 192 // and linking.
184 bool has_separate_solink_files() const { 193 bool has_separate_solink_files() const {
185 return !link_output_.empty() || !depend_output_.empty(); 194 return !link_output_.empty() || !depend_output_.empty();
186 } 195 }
187 196
188 // Substitutions required by this tool. 197 // Substitutions required by this tool.
189 const SubstitutionBits& substitution_bits() const { 198 const SubstitutionBits& substitution_bits() const {
190 DCHECK(complete_); 199 DCHECK(complete_);
191 return substitution_bits_; 200 return substitution_bits_;
192 } 201 }
193 202
203 bool OnResolved(Err* err);
204
194 private: 205 private:
195 SubstitutionPattern command_; 206 SubstitutionPattern command_;
196 std::string default_output_extension_; 207 std::string default_output_extension_;
197 SubstitutionPattern default_output_dir_; 208 SubstitutionPattern default_output_dir_;
198 SubstitutionPattern depfile_; 209 SubstitutionPattern depfile_;
199 DepsFormat depsformat_; 210 DepsFormat depsformat_;
200 PrecompiledHeaderType precompiled_header_type_; 211 PrecompiledHeaderType precompiled_header_type_;
201 SubstitutionPattern description_; 212 SubstitutionPattern description_;
202 std::string lib_switch_; 213 std::string lib_switch_;
203 std::string lib_dir_switch_; 214 std::string lib_dir_switch_;
204 SubstitutionList outputs_; 215 SubstitutionList outputs_;
205 SubstitutionPattern link_output_; 216 SubstitutionPattern link_output_;
206 SubstitutionPattern depend_output_; 217 SubstitutionPattern depend_output_;
207 SubstitutionPattern runtime_link_output_; 218 SubstitutionPattern runtime_link_output_;
208 std::string output_prefix_; 219 std::string output_prefix_;
209 bool restat_; 220 bool restat_;
210 SubstitutionPattern rspfile_; 221 SubstitutionPattern rspfile_;
211 SubstitutionPattern rspfile_content_; 222 SubstitutionPattern rspfile_content_;
223 LabelPtrPair<Pool> pool_;
212 224
213 bool complete_; 225 bool complete_;
214 226
215 SubstitutionBits substitution_bits_; 227 SubstitutionBits substitution_bits_;
216 228
217 DISALLOW_COPY_AND_ASSIGN(Tool); 229 DISALLOW_COPY_AND_ASSIGN(Tool);
218 }; 230 };
219 231
220 #endif // TOOLS_GN_TOOL_H_ 232 #endif // TOOLS_GN_TOOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698