Chromium Code Reviews| 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> |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 public: | 33 public: |
| 34 enum OutputType { | 34 enum OutputType { |
| 35 UNKNOWN, | 35 UNKNOWN, |
| 36 GROUP, | 36 GROUP, |
| 37 EXECUTABLE, | 37 EXECUTABLE, |
| 38 SHARED_LIBRARY, | 38 SHARED_LIBRARY, |
| 39 LOADABLE_MODULE, | 39 LOADABLE_MODULE, |
| 40 STATIC_LIBRARY, | 40 STATIC_LIBRARY, |
| 41 SOURCE_SET, | 41 SOURCE_SET, |
| 42 COPY_FILES, | 42 COPY_FILES, |
| 43 COPY_BUNDLE_DATA, | |
| 43 ACTION, | 44 ACTION, |
| 44 ACTION_FOREACH, | 45 ACTION_FOREACH, |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 enum DepsIterationType { | 48 enum DepsIterationType { |
| 48 DEPS_ALL, // Iterates through all public, private, and data deps. | 49 DEPS_ALL, // Iterates through all public, private, and data deps. |
| 49 DEPS_LINKED, // Iterates through all non-data dependencies. | 50 DEPS_LINKED, // Iterates through all non-data dependencies. |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 typedef std::vector<SourceFile> FileList; | 53 typedef std::vector<SourceFile> FileList; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 // directories or files. They do not need to exist, these are just passed as | 128 // directories or files. They do not need to exist, these are just passed as |
| 128 // runtime dependencies to external test systems as necessary. | 129 // runtime dependencies to external test systems as necessary. |
| 129 const std::vector<std::string>& data() const { return data_; } | 130 const std::vector<std::string>& data() const { return data_; } |
| 130 std::vector<std::string>& data() { return data_; } | 131 std::vector<std::string>& data() { return data_; } |
| 131 | 132 |
| 132 // Returns true if targets depending on this one should have an order | 133 // Returns true if targets depending on this one should have an order |
| 133 // dependency. | 134 // dependency. |
| 134 bool hard_dep() const { | 135 bool hard_dep() const { |
| 135 return output_type_ == ACTION || | 136 return output_type_ == ACTION || |
| 136 output_type_ == ACTION_FOREACH || | 137 output_type_ == ACTION_FOREACH || |
| 137 output_type_ == COPY_FILES; | 138 output_type_ == COPY_FILES || |
| 139 output_type_ == COPY_BUNDLE_DATA; | |
|
brettw
2016/01/20 22:23:17
Are you sure you need this?
The COPY_FILES rule i
sdefresne
2016/01/21 22:00:56
Good point. Removed.
| |
| 138 } | 140 } |
| 139 | 141 |
| 140 // Returns the iterator range which can be used in range-based for loops | 142 // Returns the iterator range which can be used in range-based for loops |
| 141 // to iterate over multiple types of deps in one loop: | 143 // to iterate over multiple types of deps in one loop: |
| 142 // for (const auto& pair : target->GetDeps(Target::DEPS_ALL)) ... | 144 // for (const auto& pair : target->GetDeps(Target::DEPS_ALL)) ... |
| 143 DepsIteratorRange GetDeps(DepsIterationType type) const; | 145 DepsIteratorRange GetDeps(DepsIterationType type) const; |
| 144 | 146 |
| 145 // Linked private dependencies. | 147 // Linked private dependencies. |
| 146 const LabelTargetVector& private_deps() const { return private_deps_; } | 148 const LabelTargetVector& private_deps() const { return private_deps_; } |
| 147 LabelTargetVector& private_deps() { return private_deps_; } | 149 LabelTargetVector& private_deps() { return private_deps_; } |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 | 322 |
| 321 // Output files. Empty until the target is resolved. | 323 // Output files. Empty until the target is resolved. |
| 322 std::vector<OutputFile> computed_outputs_; | 324 std::vector<OutputFile> computed_outputs_; |
| 323 OutputFile link_output_file_; | 325 OutputFile link_output_file_; |
| 324 OutputFile dependency_output_file_; | 326 OutputFile dependency_output_file_; |
| 325 | 327 |
| 326 DISALLOW_COPY_AND_ASSIGN(Target); | 328 DISALLOW_COPY_AND_ASSIGN(Target); |
| 327 }; | 329 }; |
| 328 | 330 |
| 329 #endif // TOOLS_GN_TARGET_H_ | 331 #endif // TOOLS_GN_TARGET_H_ |
| OLD | NEW |