OLD | NEW |
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/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "tools/gn/substitution_list.h" | 12 #include "tools/gn/substitution_list.h" |
13 #include "tools/gn/substitution_pattern.h" | 13 #include "tools/gn/substitution_pattern.h" |
14 | 14 |
15 class Tool { | 15 class Tool { |
16 public: | 16 public: |
17 enum DepsFormat { | 17 enum DepsFormat { |
18 DEPS_GCC = 0, | 18 DEPS_GCC = 0, |
19 DEPS_MSVC = 1 | 19 DEPS_MSVC = 1 |
20 }; | 20 }; |
21 | 21 |
| 22 enum PrecompiledHeaderType { |
| 23 PCH_NONE = 0, |
| 24 PCH_MSVC = 1 |
| 25 }; |
| 26 |
22 Tool(); | 27 Tool(); |
23 ~Tool(); | 28 ~Tool(); |
24 | 29 |
25 // Getters/setters ---------------------------------------------------------- | 30 // Getters/setters ---------------------------------------------------------- |
26 // | 31 // |
27 // After the tool has had its attributes set, the caller must call | 32 // After the tool has had its attributes set, the caller must call |
28 // SetComplete(), at which point no other changes can be made. | 33 // SetComplete(), at which point no other changes can be made. |
29 | 34 |
30 // Command to run. | 35 // Command to run. |
31 const SubstitutionPattern& command() const { | 36 const SubstitutionPattern& command() const { |
(...skipping 24 matching lines...) Expand all Loading... |
56 } | 61 } |
57 | 62 |
58 DepsFormat depsformat() const { | 63 DepsFormat depsformat() const { |
59 return depsformat_; | 64 return depsformat_; |
60 } | 65 } |
61 void set_depsformat(DepsFormat f) { | 66 void set_depsformat(DepsFormat f) { |
62 DCHECK(!complete_); | 67 DCHECK(!complete_); |
63 depsformat_ = f; | 68 depsformat_ = f; |
64 } | 69 } |
65 | 70 |
| 71 PrecompiledHeaderType precompiled_header_type() const { |
| 72 return precompiled_header_type_; |
| 73 } |
| 74 void set_precompiled_header_type(PrecompiledHeaderType pch_type) { |
| 75 precompiled_header_type_ = pch_type; |
| 76 } |
| 77 |
66 const SubstitutionPattern& description() const { | 78 const SubstitutionPattern& description() const { |
67 return description_; | 79 return description_; |
68 } | 80 } |
69 void set_description(const SubstitutionPattern& desc) { | 81 void set_description(const SubstitutionPattern& desc) { |
70 DCHECK(!complete_); | 82 DCHECK(!complete_); |
71 description_ = desc; | 83 description_ = desc; |
72 } | 84 } |
73 | 85 |
74 const std::string& lib_switch() const { | 86 const std::string& lib_switch() const { |
75 return lib_switch_; | 87 return lib_switch_; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 const SubstitutionBits& substitution_bits() const { | 172 const SubstitutionBits& substitution_bits() const { |
161 DCHECK(complete_); | 173 DCHECK(complete_); |
162 return substitution_bits_; | 174 return substitution_bits_; |
163 } | 175 } |
164 | 176 |
165 private: | 177 private: |
166 SubstitutionPattern command_; | 178 SubstitutionPattern command_; |
167 std::string default_output_extension_; | 179 std::string default_output_extension_; |
168 SubstitutionPattern depfile_; | 180 SubstitutionPattern depfile_; |
169 DepsFormat depsformat_; | 181 DepsFormat depsformat_; |
| 182 PrecompiledHeaderType precompiled_header_type_; |
170 SubstitutionPattern description_; | 183 SubstitutionPattern description_; |
171 std::string lib_switch_; | 184 std::string lib_switch_; |
172 std::string lib_dir_switch_; | 185 std::string lib_dir_switch_; |
173 SubstitutionList outputs_; | 186 SubstitutionList outputs_; |
174 SubstitutionPattern link_output_; | 187 SubstitutionPattern link_output_; |
175 SubstitutionPattern depend_output_; | 188 SubstitutionPattern depend_output_; |
176 std::string output_prefix_; | 189 std::string output_prefix_; |
177 bool restat_; | 190 bool restat_; |
178 SubstitutionPattern rspfile_; | 191 SubstitutionPattern rspfile_; |
179 SubstitutionPattern rspfile_content_; | 192 SubstitutionPattern rspfile_content_; |
180 | 193 |
181 bool complete_; | 194 bool complete_; |
182 | 195 |
183 SubstitutionBits substitution_bits_; | 196 SubstitutionBits substitution_bits_; |
184 | 197 |
185 DISALLOW_COPY_AND_ASSIGN(Tool); | 198 DISALLOW_COPY_AND_ASSIGN(Tool); |
186 }; | 199 }; |
187 | 200 |
188 #endif // TOOLS_GN_TOOL_H_ | 201 #endif // TOOLS_GN_TOOL_H_ |
OLD | NEW |