[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef TOOLS_GN_TARGET_H_ |
| 6 | #define TOOLS_GN_TARGET_H_ |
| 7 | |
| 8 | #include <set> |
| 9 | #include <string> |
| 10 | #include <vector> |
| 11 | |
brettw | 3dab5fe | 2015-06-29 23:00:15 | [diff] [blame] | 12 | #include "base/gtest_prod_util.h" |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 13 | #include "base/logging.h" |
tfarina | f51a763e | 2015-08-10 00:55:38 | [diff] [blame] | 14 | #include "base/macros.h" |
[email protected] | 2fbe101 | 2014-03-20 17:59:15 | [diff] [blame] | 15 | #include "tools/gn/action_values.h" |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 16 | #include "tools/gn/config_values.h" |
brettw | 54d76753 | 2015-04-16 17:40:49 | [diff] [blame] | 17 | #include "tools/gn/inherited_libraries.h" |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 18 | #include "tools/gn/item.h" |
[email protected] | 68d1dd3 | 2013-11-01 21:59:51 | [diff] [blame] | 19 | #include "tools/gn/label_ptr.h" |
[email protected] | b1e468f | 2013-09-10 22:58:02 | [diff] [blame] | 20 | #include "tools/gn/ordered_set.h" |
[email protected] | 0dfcae7 | 2014-08-19 22:52:16 | [diff] [blame] | 21 | #include "tools/gn/output_file.h" |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 22 | #include "tools/gn/source_file.h" |
[email protected] | 8fc5618 | 2014-08-06 21:44:33 | [diff] [blame] | 23 | #include "tools/gn/unique_vector.h" |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 24 | |
brettw | a09df11 | 2014-09-27 22:27:10 | [diff] [blame] | 25 | class DepsIteratorRange; |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 26 | class InputFile; |
| 27 | class Settings; |
| 28 | class Token; |
[email protected] | 0dfcae7 | 2014-08-19 22:52:16 | [diff] [blame] | 29 | class Toolchain; |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 30 | |
| 31 | class Target : public Item { |
| 32 | public: |
| 33 | enum OutputType { |
[email protected] | c0822d7f | 2013-08-13 17:10:56 | [diff] [blame] | 34 | UNKNOWN, |
| 35 | GROUP, |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 36 | EXECUTABLE, |
| 37 | SHARED_LIBRARY, |
andybons | 027840d | 2015-10-14 18:49:30 | [diff] [blame^] | 38 | LOADABLE_MODULE, |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 39 | STATIC_LIBRARY, |
[email protected] | 7ff2f5d | 2013-10-08 21:30:34 | [diff] [blame] | 40 | SOURCE_SET, |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 41 | COPY_FILES, |
[email protected] | 2fbe101 | 2014-03-20 17:59:15 | [diff] [blame] | 42 | ACTION, |
| 43 | ACTION_FOREACH, |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 44 | }; |
brettw | a09df11 | 2014-09-27 22:27:10 | [diff] [blame] | 45 | |
| 46 | enum DepsIterationType { |
| 47 | DEPS_ALL, // Iterates through all public, private, and data deps. |
| 48 | DEPS_LINKED, // Iterates through all non-data dependencies. |
| 49 | }; |
| 50 | |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 51 | typedef std::vector<SourceFile> FileList; |
| 52 | typedef std::vector<std::string> StringVector; |
| 53 | |
| 54 | Target(const Settings* settings, const Label& label); |
Viet-Trung Luu | 50df3ed | 2014-10-22 05:00:12 | [diff] [blame] | 55 | ~Target() override; |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 56 | |
[email protected] | ac1128e | 2013-08-23 00:26:56 | [diff] [blame] | 57 | // Returns a string naming the output type. |
| 58 | static const char* GetStringForOutputType(OutputType type); |
| 59 | |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 60 | // Item overrides. |
Viet-Trung Luu | 50df3ed | 2014-10-22 05:00:12 | [diff] [blame] | 61 | Target* AsTarget() override; |
| 62 | const Target* AsTarget() const override; |
| 63 | bool OnResolved(Err* err) override; |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 64 | |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 65 | OutputType output_type() const { return output_type_; } |
| 66 | void set_output_type(OutputType t) { output_type_ = t; } |
| 67 | |
cmasone | a426cf93 | 2014-09-13 00:51:47 | [diff] [blame] | 68 | // Can be linked into other targets. |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 69 | bool IsLinkable() const; |
| 70 | |
cmasone | a426cf93 | 2014-09-13 00:51:47 | [diff] [blame] | 71 | // Can have dependencies linked in. |
| 72 | bool IsFinal() const; |
| 73 | |
[email protected] | b5c19e3 | 2013-09-10 23:01:25 | [diff] [blame] | 74 | // Will be the empty string to use the target label as the output name. |
[email protected] | 0dfcae7 | 2014-08-19 22:52:16 | [diff] [blame] | 75 | // See GetComputedOutputName(). |
[email protected] | b5c19e3 | 2013-09-10 23:01:25 | [diff] [blame] | 76 | const std::string& output_name() const { return output_name_; } |
| 77 | void set_output_name(const std::string& name) { output_name_ = name; } |
| 78 | |
[email protected] | 0dfcae7 | 2014-08-19 22:52:16 | [diff] [blame] | 79 | // Returns the output name for this target, which is the output_name if |
| 80 | // specified, or the target label if not. If the flag is set, it will also |
| 81 | // include any output prefix specified on the tool (often "lib" on Linux). |
| 82 | // |
| 83 | // Because this depends on the tool for this target, the toolchain must |
| 84 | // have been set before calling. |
| 85 | std::string GetComputedOutputName(bool include_prefix) const; |
| 86 | |
[email protected] | b9473ee | 2014-02-28 21:51:10 | [diff] [blame] | 87 | const std::string& output_extension() const { return output_extension_; } |
| 88 | void set_output_extension(const std::string& extension) { |
| 89 | output_extension_ = extension; |
| 90 | } |
| 91 | |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 92 | const FileList& sources() const { return sources_; } |
[email protected] | 3c1274d | 2013-09-10 22:21:21 | [diff] [blame] | 93 | FileList& sources() { return sources_; } |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 94 | |
[email protected] | 126d8b5 | 2014-04-07 22:17:35 | [diff] [blame] | 95 | // Set to true when all sources are public. This is the default. In this case |
| 96 | // the public headers list should be empty. |
| 97 | bool all_headers_public() const { return all_headers_public_; } |
| 98 | void set_all_headers_public(bool p) { all_headers_public_ = p; } |
| 99 | |
| 100 | // When all_headers_public is false, this is the list of public headers. It |
| 101 | // could be empty which would mean no headers are public. |
| 102 | const FileList& public_headers() const { return public_headers_; } |
| 103 | FileList& public_headers() { return public_headers_; } |
| 104 | |
brettw | 81db36a | 2014-08-29 22:52:36 | [diff] [blame] | 105 | // Whether this target's includes should be checked by "gn check". |
| 106 | bool check_includes() const { return check_includes_; } |
| 107 | void set_check_includes(bool ci) { check_includes_ = ci; } |
| 108 | |
cmasone | a426cf93 | 2014-09-13 00:51:47 | [diff] [blame] | 109 | // Whether this static_library target should have code linked in. |
| 110 | bool complete_static_lib() const { return complete_static_lib_; } |
| 111 | void set_complete_static_lib(bool complete) { |
| 112 | DCHECK_EQ(STATIC_LIBRARY, output_type_); |
| 113 | complete_static_lib_ = complete; |
| 114 | } |
| 115 | |
Brett Wilson | 85423a0 | 2014-09-02 19:29:42 | [diff] [blame] | 116 | bool testonly() const { return testonly_; } |
| 117 | void set_testonly(bool value) { testonly_ = value; } |
| 118 | |
[email protected] | 234be520 | 2013-09-11 20:44:02 | [diff] [blame] | 119 | // Compile-time extra dependencies. |
[email protected] | 61a6fca | 2014-06-17 20:26:53 | [diff] [blame] | 120 | const FileList& inputs() const { return inputs_; } |
| 121 | FileList& inputs() { return inputs_; } |
[email protected] | 234be520 | 2013-09-11 20:44:02 | [diff] [blame] | 122 | |
brettw | e903c0f | 2015-06-03 22:40:17 | [diff] [blame] | 123 | // Runtime dependencies. These are "file-like things" that can either be |
| 124 | // directories or files. They do not need to exist, these are just passed as |
| 125 | // runtime dependencies to external test systems as necessary. |
| 126 | const std::vector<std::string>& data() const { return data_; } |
| 127 | std::vector<std::string>& data() { return data_; } |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 128 | |
[email protected] | ef348fe | 2014-05-01 18:31:31 | [diff] [blame] | 129 | // Returns true if targets depending on this one should have an order |
| 130 | // dependency. |
| 131 | bool hard_dep() const { |
| 132 | return output_type_ == ACTION || |
| 133 | output_type_ == ACTION_FOREACH || |
| 134 | output_type_ == COPY_FILES; |
| 135 | } |
[email protected] | 234be520 | 2013-09-11 20:44:02 | [diff] [blame] | 136 | |
brettw | a09df11 | 2014-09-27 22:27:10 | [diff] [blame] | 137 | // Returns the iterator range which can be used in range-based for loops |
| 138 | // to iterate over multiple types of deps in one loop: |
| 139 | // for (const auto& pair : target->GetDeps(Target::DEPS_ALL)) ... |
| 140 | DepsIteratorRange GetDeps(DepsIterationType type) const; |
| 141 | |
brettw | c2e821a3 | 2014-09-17 01:07:14 | [diff] [blame] | 142 | // Linked private dependencies. |
| 143 | const LabelTargetVector& private_deps() const { return private_deps_; } |
| 144 | LabelTargetVector& private_deps() { return private_deps_; } |
| 145 | |
| 146 | // Linked public dependencies. |
| 147 | const LabelTargetVector& public_deps() const { return public_deps_; } |
| 148 | LabelTargetVector& public_deps() { return public_deps_; } |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 149 | |
[email protected] | 4441041b | 2013-08-06 21:11:06 | [diff] [blame] | 150 | // Non-linked dependencies. |
brettw | c2e821a3 | 2014-09-17 01:07:14 | [diff] [blame] | 151 | const LabelTargetVector& data_deps() const { return data_deps_; } |
| 152 | LabelTargetVector& data_deps() { return data_deps_; } |
[email protected] | 4441041b | 2013-08-06 21:11:06 | [diff] [blame] | 153 | |
[email protected] | 08035b9 | 2014-05-13 19:40:56 | [diff] [blame] | 154 | // List of configs that this class inherits settings from. Once a target is |
brettw | c2e821a3 | 2014-09-17 01:07:14 | [diff] [blame] | 155 | // resolved, this will also list all-dependent and public configs. |
[email protected] | 8fc5618 | 2014-08-06 21:44:33 | [diff] [blame] | 156 | const UniqueVector<LabelConfigPair>& configs() const { return configs_; } |
| 157 | UniqueVector<LabelConfigPair>& configs() { return configs_; } |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 158 | |
| 159 | // List of configs that all dependencies (direct and indirect) of this |
[email protected] | 62a61063 | 2013-08-21 23:45:23 | [diff] [blame] | 160 | // target get. These configs are not added to this target. Note that due |
| 161 | // to the way this is computed, there may be duplicates in this list. |
[email protected] | 8fc5618 | 2014-08-06 21:44:33 | [diff] [blame] | 162 | const UniqueVector<LabelConfigPair>& all_dependent_configs() const { |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 163 | return all_dependent_configs_; |
| 164 | } |
[email protected] | 8fc5618 | 2014-08-06 21:44:33 | [diff] [blame] | 165 | UniqueVector<LabelConfigPair>& all_dependent_configs() { |
[email protected] | 3c1274d | 2013-09-10 22:21:21 | [diff] [blame] | 166 | return all_dependent_configs_; |
| 167 | } |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 168 | |
| 169 | // List of configs that targets depending directly on this one get. These |
brettw | c2e821a3 | 2014-09-17 01:07:14 | [diff] [blame] | 170 | // configs are also added to this target. |
| 171 | const UniqueVector<LabelConfigPair>& public_configs() const { |
| 172 | return public_configs_; |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 173 | } |
brettw | c2e821a3 | 2014-09-17 01:07:14 | [diff] [blame] | 174 | UniqueVector<LabelConfigPair>& public_configs() { |
| 175 | return public_configs_; |
[email protected] | 3c1274d | 2013-09-10 22:21:21 | [diff] [blame] | 176 | } |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 177 | |
brettw | 81db36a | 2014-08-29 22:52:36 | [diff] [blame] | 178 | // Dependencies that can include files from this target. |
| 179 | const std::set<Label>& allow_circular_includes_from() const { |
| 180 | return allow_circular_includes_from_; |
| 181 | } |
| 182 | std::set<Label>& allow_circular_includes_from() { |
| 183 | return allow_circular_includes_from_; |
| 184 | } |
| 185 | |
brettw | 54d76753 | 2015-04-16 17:40:49 | [diff] [blame] | 186 | const InheritedLibraries& inherited_libraries() const { |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 187 | return inherited_libraries_; |
| 188 | } |
| 189 | |
| 190 | // This config represents the configuration set directly on this target. |
| 191 | ConfigValues& config_values() { return config_values_; } |
| 192 | const ConfigValues& config_values() const { return config_values_; } |
| 193 | |
[email protected] | 2fbe101 | 2014-03-20 17:59:15 | [diff] [blame] | 194 | ActionValues& action_values() { return action_values_; } |
| 195 | const ActionValues& action_values() const { return action_values_; } |
[email protected] | c0822d7f | 2013-08-13 17:10:56 | [diff] [blame] | 196 | |
[email protected] | 2ed04ae | 2013-10-07 20:17:16 | [diff] [blame] | 197 | const OrderedSet<SourceDir>& all_lib_dirs() const { return all_lib_dirs_; } |
| 198 | const OrderedSet<std::string>& all_libs() const { return all_libs_; } |
[email protected] | 3c1274d | 2013-09-10 22:21:21 | [diff] [blame] | 199 | |
[email protected] | ef348fe | 2014-05-01 18:31:31 | [diff] [blame] | 200 | const std::set<const Target*>& recursive_hard_deps() const { |
| 201 | return recursive_hard_deps_; |
| 202 | } |
| 203 | |
[email protected] | 0dfcae7 | 2014-08-19 22:52:16 | [diff] [blame] | 204 | // The toolchain is only known once this target is resolved (all if its |
| 205 | // dependencies are known). They will be null until then. Generally, this can |
| 206 | // only be used during target writing. |
| 207 | const Toolchain* toolchain() const { return toolchain_; } |
| 208 | |
| 209 | // Sets the toolchain. The toolchain must include a tool for this target |
| 210 | // or the error will be set and the function will return false. Unusually, |
| 211 | // this function's "err" output is optional since this is commonly used |
| 212 | // frequently by unit tests which become needlessly verbose. |
tfarina | 02633587 | 2015-01-13 03:35:39 | [diff] [blame] | 213 | bool SetToolchain(const Toolchain* toolchain, Err* err = nullptr); |
[email protected] | 0dfcae7 | 2014-08-19 22:52:16 | [diff] [blame] | 214 | |
brettw | 56affab | 2015-06-04 22:01:03 | [diff] [blame] | 215 | // Once this target has been resolved, all outputs from the target will be |
| 216 | // listed here. This will include things listed in the "outputs" for an |
| 217 | // action or a copy step, and the output library or executable file(s) from |
| 218 | // binary targets. |
| 219 | // |
| 220 | // It will NOT include stamp files and object files. |
| 221 | const std::vector<OutputFile>& computed_outputs() const { |
| 222 | return computed_outputs_; |
| 223 | } |
| 224 | |
[email protected] | 0dfcae7 | 2014-08-19 22:52:16 | [diff] [blame] | 225 | // Returns outputs from this target. The link output file is the one that |
| 226 | // other targets link to when they depend on this target. This will only be |
| 227 | // valid for libraries and will be empty for all other target types. |
| 228 | // |
| 229 | // The dependency output file is the file that should be used to express |
| 230 | // a dependency on this one. It could be the same as the link output file |
| 231 | // (this will be the case for static libraries). For shared libraries it |
| 232 | // could be the same or different than the link output file, depending on the |
| 233 | // system. For actions this will be the stamp file. |
| 234 | // |
| 235 | // These are only known once the target is resolved and will be empty before |
| 236 | // that. This is a cache of the files to prevent every target that depends on |
| 237 | // a given library from recomputing the same pattern. |
| 238 | const OutputFile& link_output_file() const { |
| 239 | return link_output_file_; |
| 240 | } |
| 241 | const OutputFile& dependency_output_file() const { |
| 242 | return dependency_output_file_; |
| 243 | } |
| 244 | |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 245 | private: |
brettw | 3dab5fe | 2015-06-29 23:00:15 | [diff] [blame] | 246 | FRIEND_TEST_ALL_PREFIXES(Target, ResolvePrecompiledHeaders); |
| 247 | |
[email protected] | ef348fe | 2014-05-01 18:31:31 | [diff] [blame] | 248 | // Pulls necessary information from dependencies to this one when all |
[email protected] | 3c1274d | 2013-09-10 22:21:21 | [diff] [blame] | 249 | // dependencies have been resolved. |
brettw | 54d76753 | 2015-04-16 17:40:49 | [diff] [blame] | 250 | void PullDependentTarget(const Target* dep, bool is_public); |
| 251 | void PullDependentTargets(); |
[email protected] | 3c1274d | 2013-09-10 22:21:21 | [diff] [blame] | 252 | |
[email protected] | ef348fe | 2014-05-01 18:31:31 | [diff] [blame] | 253 | // These each pull specific things from dependencies to this one when all |
| 254 | // deps have been resolved. |
tfarina | b445e7c | 2015-10-08 21:38:56 | [diff] [blame] | 255 | void PullPublicConfigs(); |
| 256 | void PullPublicConfigsFrom(const Target* from); |
[email protected] | ef348fe | 2014-05-01 18:31:31 | [diff] [blame] | 257 | void PullRecursiveHardDeps(); |
[email protected] | 8499f51f | 2014-04-24 23:43:02 | [diff] [blame] | 258 | |
[email protected] | 0dfcae7 | 2014-08-19 22:52:16 | [diff] [blame] | 259 | // Fills the link and dependency output files when a target is resolved. |
| 260 | void FillOutputFiles(); |
| 261 | |
brettw | 3dab5fe | 2015-06-29 23:00:15 | [diff] [blame] | 262 | // Checks precompiled headers from configs and makes sure the resulting |
| 263 | // values are in config_values_. |
| 264 | bool ResolvePrecompiledHeaders(Err* err); |
| 265 | |
Brett Wilson | 85423a0 | 2014-09-02 19:29:42 | [diff] [blame] | 266 | // Validates the given thing when a target is resolved. |
| 267 | bool CheckVisibility(Err* err) const; |
| 268 | bool CheckTestonly(Err* err) const; |
cmasone | a6fa714 | 2014-09-18 23:47:38 | [diff] [blame] | 269 | bool CheckNoNestedStaticLibs(Err* err) const; |
brettw | 56affab | 2015-06-04 22:01:03 | [diff] [blame] | 270 | void CheckSourcesGenerated() const; |
| 271 | void CheckSourceGenerated(const SourceFile& source) const; |
Brett Wilson | 85423a0 | 2014-09-02 19:29:42 | [diff] [blame] | 272 | |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 273 | OutputType output_type_; |
[email protected] | b5c19e3 | 2013-09-10 23:01:25 | [diff] [blame] | 274 | std::string output_name_; |
[email protected] | b9473ee | 2014-02-28 21:51:10 | [diff] [blame] | 275 | std::string output_extension_; |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 276 | |
| 277 | FileList sources_; |
[email protected] | 126d8b5 | 2014-04-07 22:17:35 | [diff] [blame] | 278 | bool all_headers_public_; |
| 279 | FileList public_headers_; |
brettw | 81db36a | 2014-08-29 22:52:36 | [diff] [blame] | 280 | bool check_includes_; |
cmasone | a426cf93 | 2014-09-13 00:51:47 | [diff] [blame] | 281 | bool complete_static_lib_; |
Brett Wilson | 85423a0 | 2014-09-02 19:29:42 | [diff] [blame] | 282 | bool testonly_; |
[email protected] | 61a6fca | 2014-06-17 20:26:53 | [diff] [blame] | 283 | FileList inputs_; |
brettw | e903c0f | 2015-06-03 22:40:17 | [diff] [blame] | 284 | std::vector<std::string> data_; |
[email protected] | 3c1274d | 2013-09-10 22:21:21 | [diff] [blame] | 285 | |
brettw | c2e821a3 | 2014-09-17 01:07:14 | [diff] [blame] | 286 | LabelTargetVector private_deps_; |
| 287 | LabelTargetVector public_deps_; |
| 288 | LabelTargetVector data_deps_; |
[email protected] | 3c1274d | 2013-09-10 22:21:21 | [diff] [blame] | 289 | |
[email protected] | 8fc5618 | 2014-08-06 21:44:33 | [diff] [blame] | 290 | UniqueVector<LabelConfigPair> configs_; |
| 291 | UniqueVector<LabelConfigPair> all_dependent_configs_; |
brettw | c2e821a3 | 2014-09-17 01:07:14 | [diff] [blame] | 292 | UniqueVector<LabelConfigPair> public_configs_; |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 293 | |
brettw | 81db36a | 2014-08-29 22:52:36 | [diff] [blame] | 294 | std::set<Label> allow_circular_includes_from_; |
| 295 | |
brettw | 54d76753 | 2015-04-16 17:40:49 | [diff] [blame] | 296 | // Static libraries, shared libraries, and source sets from transitive deps |
| 297 | // that need to be linked. |
| 298 | InheritedLibraries inherited_libraries_; |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 299 | |
[email protected] | 2ed04ae | 2013-10-07 20:17:16 | [diff] [blame] | 300 | // These libs and dirs are inherited from statically linked deps and all |
| 301 | // configs applying to this target. |
| 302 | OrderedSet<SourceDir> all_lib_dirs_; |
| 303 | OrderedSet<std::string> all_libs_; |
[email protected] | 3c1274d | 2013-09-10 22:21:21 | [diff] [blame] | 304 | |
[email protected] | ef348fe | 2014-05-01 18:31:31 | [diff] [blame] | 305 | // 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 | std::set<const Target*> recursive_hard_deps_; |
| 308 | |
brettw | 3dab5fe | 2015-06-29 23:00:15 | [diff] [blame] | 309 | // 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 | // headers are used. |
| 312 | ConfigValues config_values_; |
| 313 | |
| 314 | // Used for action[_foreach] targets. |
| 315 | ActionValues action_values_; |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 316 | |
[email protected] | 0dfcae7 | 2014-08-19 22:52:16 | [diff] [blame] | 317 | // Toolchain used by this target. Null until target is resolved. |
| 318 | const Toolchain* toolchain_; |
| 319 | |
brettw | 56affab | 2015-06-04 22:01:03 | [diff] [blame] | 320 | // Output files. Empty until the target is resolved. |
| 321 | std::vector<OutputFile> computed_outputs_; |
[email protected] | 0dfcae7 | 2014-08-19 22:52:16 | [diff] [blame] | 322 | OutputFile link_output_file_; |
| 323 | OutputFile dependency_output_file_; |
| 324 | |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 325 | DISALLOW_COPY_AND_ASSIGN(Target); |
| 326 | }; |
| 327 | |
[email protected] | 96ea63d | 2013-07-30 10:17:07 | [diff] [blame] | 328 | #endif // TOOLS_GN_TARGET_H_ |