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