OLD | NEW |
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> |
11 | 11 |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "tools/gn/action_values.h" | 15 #include "tools/gn/action_values.h" |
16 #include "tools/gn/config_values.h" | 16 #include "tools/gn/config_values.h" |
17 #include "tools/gn/inherited_libraries.h" | 17 #include "tools/gn/inherited_libraries.h" |
18 #include "tools/gn/item.h" | 18 #include "tools/gn/item.h" |
19 #include "tools/gn/label_ptr.h" | 19 #include "tools/gn/label_ptr.h" |
| 20 #include "tools/gn/lib_file.h" |
20 #include "tools/gn/ordered_set.h" | 21 #include "tools/gn/ordered_set.h" |
21 #include "tools/gn/output_file.h" | 22 #include "tools/gn/output_file.h" |
22 #include "tools/gn/source_file.h" | 23 #include "tools/gn/source_file.h" |
23 #include "tools/gn/unique_vector.h" | 24 #include "tools/gn/unique_vector.h" |
24 | 25 |
25 class DepsIteratorRange; | 26 class DepsIteratorRange; |
26 class InputFile; | 27 class InputFile; |
27 class Settings; | 28 class Settings; |
28 class Token; | 29 class Token; |
29 class Toolchain; | 30 class Toolchain; |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 191 } |
191 | 192 |
192 // This config represents the configuration set directly on this target. | 193 // This config represents the configuration set directly on this target. |
193 ConfigValues& config_values() { return config_values_; } | 194 ConfigValues& config_values() { return config_values_; } |
194 const ConfigValues& config_values() const { return config_values_; } | 195 const ConfigValues& config_values() const { return config_values_; } |
195 | 196 |
196 ActionValues& action_values() { return action_values_; } | 197 ActionValues& action_values() { return action_values_; } |
197 const ActionValues& action_values() const { return action_values_; } | 198 const ActionValues& action_values() const { return action_values_; } |
198 | 199 |
199 const OrderedSet<SourceDir>& all_lib_dirs() const { return all_lib_dirs_; } | 200 const OrderedSet<SourceDir>& all_lib_dirs() const { return all_lib_dirs_; } |
200 const OrderedSet<std::string>& all_libs() const { return all_libs_; } | 201 const OrderedSet<LibFile>& all_libs() const { return all_libs_; } |
201 | 202 |
202 const std::set<const Target*>& recursive_hard_deps() const { | 203 const std::set<const Target*>& recursive_hard_deps() const { |
203 return recursive_hard_deps_; | 204 return recursive_hard_deps_; |
204 } | 205 } |
205 | 206 |
206 // The toolchain is only known once this target is resolved (all if its | 207 // The toolchain is only known once this target is resolved (all if its |
207 // dependencies are known). They will be null until then. Generally, this can | 208 // dependencies are known). They will be null until then. Generally, this can |
208 // only be used during target writing. | 209 // only be used during target writing. |
209 const Toolchain* toolchain() const { return toolchain_; } | 210 const Toolchain* toolchain() const { return toolchain_; } |
210 | 211 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 | 294 |
294 std::set<Label> allow_circular_includes_from_; | 295 std::set<Label> allow_circular_includes_from_; |
295 | 296 |
296 // Static libraries, shared libraries, and source sets from transitive deps | 297 // Static libraries, shared libraries, and source sets from transitive deps |
297 // that need to be linked. | 298 // that need to be linked. |
298 InheritedLibraries inherited_libraries_; | 299 InheritedLibraries inherited_libraries_; |
299 | 300 |
300 // These libs and dirs are inherited from statically linked deps and all | 301 // These libs and dirs are inherited from statically linked deps and all |
301 // configs applying to this target. | 302 // configs applying to this target. |
302 OrderedSet<SourceDir> all_lib_dirs_; | 303 OrderedSet<SourceDir> all_lib_dirs_; |
303 OrderedSet<std::string> all_libs_; | 304 OrderedSet<LibFile> all_libs_; |
304 | 305 |
305 // All hard deps from this target and all dependencies. Filled in when this | 306 // All hard deps from this target and all dependencies. Filled in when this |
306 // target is marked resolved. This will not include the current target. | 307 // target is marked resolved. This will not include the current target. |
307 std::set<const Target*> recursive_hard_deps_; | 308 std::set<const Target*> recursive_hard_deps_; |
308 | 309 |
309 // Used for all binary targets. The precompiled header values in this struct | 310 // Used for all binary targets. The precompiled header values in this struct |
310 // will be resolved to the ones to use for this target, if precompiled | 311 // will be resolved to the ones to use for this target, if precompiled |
311 // headers are used. | 312 // headers are used. |
312 ConfigValues config_values_; | 313 ConfigValues config_values_; |
313 | 314 |
314 // Used for action[_foreach] targets. | 315 // Used for action[_foreach] targets. |
315 ActionValues action_values_; | 316 ActionValues action_values_; |
316 | 317 |
317 // Toolchain used by this target. Null until target is resolved. | 318 // Toolchain used by this target. Null until target is resolved. |
318 const Toolchain* toolchain_; | 319 const Toolchain* toolchain_; |
319 | 320 |
320 // Output files. Empty until the target is resolved. | 321 // Output files. Empty until the target is resolved. |
321 std::vector<OutputFile> computed_outputs_; | 322 std::vector<OutputFile> computed_outputs_; |
322 OutputFile link_output_file_; | 323 OutputFile link_output_file_; |
323 OutputFile dependency_output_file_; | 324 OutputFile dependency_output_file_; |
324 | 325 |
325 DISALLOW_COPY_AND_ASSIGN(Target); | 326 DISALLOW_COPY_AND_ASSIGN(Target); |
326 }; | 327 }; |
327 | 328 |
328 #endif // TOOLS_GN_TARGET_H_ | 329 #endif // TOOLS_GN_TARGET_H_ |
OLD | NEW |