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

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

Issue 516683002: Add GN variables for controlling header checking. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@desc
Patch Set: Created 6 years, 3 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 (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 #ifndef TOOLS_GN_TARGET_H_ 5 #ifndef TOOLS_GN_TARGET_H_
6 #define TOOLS_GN_TARGET_H_ 6 #define TOOLS_GN_TARGET_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // Set to true when all sources are public. This is the default. In this case 84 // Set to true when all sources are public. This is the default. In this case
85 // the public headers list should be empty. 85 // the public headers list should be empty.
86 bool all_headers_public() const { return all_headers_public_; } 86 bool all_headers_public() const { return all_headers_public_; }
87 void set_all_headers_public(bool p) { all_headers_public_ = p; } 87 void set_all_headers_public(bool p) { all_headers_public_ = p; }
88 88
89 // When all_headers_public is false, this is the list of public headers. It 89 // When all_headers_public is false, this is the list of public headers. It
90 // could be empty which would mean no headers are public. 90 // could be empty which would mean no headers are public.
91 const FileList& public_headers() const { return public_headers_; } 91 const FileList& public_headers() const { return public_headers_; }
92 FileList& public_headers() { return public_headers_; } 92 FileList& public_headers() { return public_headers_; }
93 93
94 // Whether this target's includes should be checked by "gn check".
95 bool check_includes() const { return check_includes_; }
96 void set_check_includes(bool ci) { check_includes_ = ci; }
97
94 // Compile-time extra dependencies. 98 // Compile-time extra dependencies.
95 const FileList& inputs() const { return inputs_; } 99 const FileList& inputs() const { return inputs_; }
96 FileList& inputs() { return inputs_; } 100 FileList& inputs() { return inputs_; }
97 101
98 // Runtime dependencies. 102 // Runtime dependencies.
99 const FileList& data() const { return data_; } 103 const FileList& data() const { return data_; }
100 FileList& data() { return data_; } 104 FileList& data() { return data_; }
101 105
102 // Returns true if targets depending on this one should have an order 106 // Returns true if targets depending on this one should have an order
103 // dependency. 107 // dependency.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 145
142 // A list of a subset of deps where we'll re-export direct_dependent_configs 146 // A list of a subset of deps where we'll re-export direct_dependent_configs
143 // as direct_dependent_configs of this target. 147 // as direct_dependent_configs of this target.
144 const UniqueVector<LabelTargetPair>& forward_dependent_configs() const { 148 const UniqueVector<LabelTargetPair>& forward_dependent_configs() const {
145 return forward_dependent_configs_; 149 return forward_dependent_configs_;
146 } 150 }
147 UniqueVector<LabelTargetPair>& forward_dependent_configs() { 151 UniqueVector<LabelTargetPair>& forward_dependent_configs() {
148 return forward_dependent_configs_; 152 return forward_dependent_configs_;
149 } 153 }
150 154
155 // Dependencies that can include files from this target.
156 const std::set<Label>& allow_circular_includes_from() const {
157 return allow_circular_includes_from_;
158 }
159 std::set<Label>& allow_circular_includes_from() {
160 return allow_circular_includes_from_;
161 }
162
151 const UniqueVector<const Target*>& inherited_libraries() const { 163 const UniqueVector<const Target*>& inherited_libraries() const {
152 return inherited_libraries_; 164 return inherited_libraries_;
153 } 165 }
154 166
155 // This config represents the configuration set directly on this target. 167 // This config represents the configuration set directly on this target.
156 ConfigValues& config_values() { return config_values_; } 168 ConfigValues& config_values() { return config_values_; }
157 const ConfigValues& config_values() const { return config_values_; } 169 const ConfigValues& config_values() const { return config_values_; }
158 170
159 ActionValues& action_values() { return action_values_; } 171 ActionValues& action_values() { return action_values_; }
160 const ActionValues& action_values() const { return action_values_; } 172 const ActionValues& action_values() const { return action_values_; }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 // Fills the link and dependency output files when a target is resolved. 222 // Fills the link and dependency output files when a target is resolved.
211 void FillOutputFiles(); 223 void FillOutputFiles();
212 224
213 OutputType output_type_; 225 OutputType output_type_;
214 std::string output_name_; 226 std::string output_name_;
215 std::string output_extension_; 227 std::string output_extension_;
216 228
217 FileList sources_; 229 FileList sources_;
218 bool all_headers_public_; 230 bool all_headers_public_;
219 FileList public_headers_; 231 FileList public_headers_;
232 bool check_includes_;
220 FileList inputs_; 233 FileList inputs_;
221 FileList data_; 234 FileList data_;
222 235
223 bool hard_dep_; 236 bool hard_dep_;
224 237
225 // Note that if there are any groups in the deps, once the target is resolved 238 // Note that if there are any groups in the deps, once the target is resolved
226 // these vectors will list *both* the groups as well as the groups' deps. 239 // these vectors will list *both* the groups as well as the groups' deps.
227 // 240 //
228 // This is because, in general, groups should be "transparent" ways to add 241 // This is because, in general, groups should be "transparent" ways to add
229 // groups of dependencies, so adding the groups deps make this happen with 242 // groups of dependencies, so adding the groups deps make this happen with
230 // no additional complexity when iterating over a target's deps. 243 // no additional complexity when iterating over a target's deps.
231 // 244 //
232 // However, a group may also have specific settings and configs added to it, 245 // However, a group may also have specific settings and configs added to it,
233 // so we also need the group in the list so we find these things. But you 246 // so we also need the group in the list so we find these things. But you
234 // shouldn't need to look inside the deps of the group since those will 247 // shouldn't need to look inside the deps of the group since those will
235 // already be added. 248 // already be added.
236 LabelTargetVector deps_; 249 LabelTargetVector deps_;
237 LabelTargetVector datadeps_; 250 LabelTargetVector datadeps_;
238 251
239 UniqueVector<LabelConfigPair> configs_; 252 UniqueVector<LabelConfigPair> configs_;
240 UniqueVector<LabelConfigPair> all_dependent_configs_; 253 UniqueVector<LabelConfigPair> all_dependent_configs_;
241 UniqueVector<LabelConfigPair> direct_dependent_configs_; 254 UniqueVector<LabelConfigPair> direct_dependent_configs_;
242 UniqueVector<LabelTargetPair> forward_dependent_configs_; 255 UniqueVector<LabelTargetPair> forward_dependent_configs_;
243 256
257 std::set<Label> allow_circular_includes_from_;
258
244 bool external_; 259 bool external_;
245 260
246 // Static libraries and source sets from transitive deps. These things need 261 // Static libraries and source sets from transitive deps. These things need
247 // to be linked only with the end target (executable, shared library). Source 262 // to be linked only with the end target (executable, shared library). Source
248 // sets do not get pushed beyond static library boundaries, and neither 263 // sets do not get pushed beyond static library boundaries, and neither
249 // source sets nor static libraries get pushed beyond sahred library 264 // source sets nor static libraries get pushed beyond sahred library
250 // boundaries. 265 // boundaries.
251 UniqueVector<const Target*> inherited_libraries_; 266 UniqueVector<const Target*> inherited_libraries_;
252 267
253 // These libs and dirs are inherited from statically linked deps and all 268 // These libs and dirs are inherited from statically linked deps and all
(...skipping 28 matching lines...) Expand all
282 }; 297 };
283 #elif defined(COMPILER_MSVC) 298 #elif defined(COMPILER_MSVC)
284 inline size_t hash_value(const Target* t) { 299 inline size_t hash_value(const Target* t) {
285 return reinterpret_cast<size_t>(t); 300 return reinterpret_cast<size_t>(t);
286 } 301 }
287 #endif // COMPILER... 302 #endif // COMPILER...
288 303
289 } // namespace BASE_HASH_NAMESPACE 304 } // namespace BASE_HASH_NAMESPACE
290 305
291 #endif // TOOLS_GN_TARGET_H_ 306 #endif // TOOLS_GN_TARGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698