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 17 matching lines...) Expand all Loading... |
28 class Token; | 28 class Token; |
29 class Toolchain; | 29 class Toolchain; |
30 | 30 |
31 class Target : public Item { | 31 class Target : public Item { |
32 public: | 32 public: |
33 enum OutputType { | 33 enum OutputType { |
34 UNKNOWN, | 34 UNKNOWN, |
35 GROUP, | 35 GROUP, |
36 EXECUTABLE, | 36 EXECUTABLE, |
37 SHARED_LIBRARY, | 37 SHARED_LIBRARY, |
| 38 LOADABLE_MODULE, |
38 STATIC_LIBRARY, | 39 STATIC_LIBRARY, |
39 SOURCE_SET, | 40 SOURCE_SET, |
40 COPY_FILES, | 41 COPY_FILES, |
41 ACTION, | 42 ACTION, |
42 ACTION_FOREACH, | 43 ACTION_FOREACH, |
43 }; | 44 }; |
44 | 45 |
45 enum DepsIterationType { | 46 enum DepsIterationType { |
46 DEPS_ALL, // Iterates through all public, private, and data deps. | 47 DEPS_ALL, // Iterates through all public, private, and data deps. |
47 DEPS_LINKED, // Iterates through all non-data dependencies. | 48 DEPS_LINKED, // Iterates through all non-data dependencies. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // Whether this static_library target should have code linked in. | 109 // Whether this static_library target should have code linked in. |
109 bool complete_static_lib() const { return complete_static_lib_; } | 110 bool complete_static_lib() const { return complete_static_lib_; } |
110 void set_complete_static_lib(bool complete) { | 111 void set_complete_static_lib(bool complete) { |
111 DCHECK_EQ(STATIC_LIBRARY, output_type_); | 112 DCHECK_EQ(STATIC_LIBRARY, output_type_); |
112 complete_static_lib_ = complete; | 113 complete_static_lib_ = complete; |
113 } | 114 } |
114 | 115 |
115 bool testonly() const { return testonly_; } | 116 bool testonly() const { return testonly_; } |
116 void set_testonly(bool value) { testonly_ = value; } | 117 void set_testonly(bool value) { testonly_ = value; } |
117 | 118 |
| 119 // Whether this target should produce a bundle on Darwin platforms. A bundle |
| 120 // is a directory with a standardized hierarchical structure that holds |
| 121 // executable code and the resources used by that code. Examples are |
| 122 // application bundles (.app) or framework bundles (.framework) with the |
| 123 // former corresponding to executables and the latter to shared libraries. |
| 124 bool darwin_bundle() const { return darwin_bundle_; } |
| 125 void set_darwin_bundle(bool value) { darwin_bundle_ = value; } |
| 126 |
118 // Compile-time extra dependencies. | 127 // Compile-time extra dependencies. |
119 const FileList& inputs() const { return inputs_; } | 128 const FileList& inputs() const { return inputs_; } |
120 FileList& inputs() { return inputs_; } | 129 FileList& inputs() { return inputs_; } |
121 | 130 |
122 // Runtime dependencies. These are "file-like things" that can either be | 131 // Runtime dependencies. These are "file-like things" that can either be |
123 // directories or files. They do not need to exist, these are just passed as | 132 // directories or files. They do not need to exist, these are just passed as |
124 // runtime dependencies to external test systems as necessary. | 133 // runtime dependencies to external test systems as necessary. |
125 const std::vector<std::string>& data() const { return data_; } | 134 const std::vector<std::string>& data() const { return data_; } |
126 std::vector<std::string>& data() { return data_; } | 135 std::vector<std::string>& data() { return data_; } |
127 | 136 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 OutputType output_type_; | 281 OutputType output_type_; |
273 std::string output_name_; | 282 std::string output_name_; |
274 std::string output_extension_; | 283 std::string output_extension_; |
275 | 284 |
276 FileList sources_; | 285 FileList sources_; |
277 bool all_headers_public_; | 286 bool all_headers_public_; |
278 FileList public_headers_; | 287 FileList public_headers_; |
279 bool check_includes_; | 288 bool check_includes_; |
280 bool complete_static_lib_; | 289 bool complete_static_lib_; |
281 bool testonly_; | 290 bool testonly_; |
| 291 bool darwin_bundle_; |
282 FileList inputs_; | 292 FileList inputs_; |
283 std::vector<std::string> data_; | 293 std::vector<std::string> data_; |
284 | 294 |
285 LabelTargetVector private_deps_; | 295 LabelTargetVector private_deps_; |
286 LabelTargetVector public_deps_; | 296 LabelTargetVector public_deps_; |
287 LabelTargetVector data_deps_; | 297 LabelTargetVector data_deps_; |
288 | 298 |
289 UniqueVector<LabelConfigPair> configs_; | 299 UniqueVector<LabelConfigPair> configs_; |
290 UniqueVector<LabelConfigPair> all_dependent_configs_; | 300 UniqueVector<LabelConfigPair> all_dependent_configs_; |
291 UniqueVector<LabelConfigPair> public_configs_; | 301 UniqueVector<LabelConfigPair> public_configs_; |
(...skipping 26 matching lines...) Expand all Loading... |
318 | 328 |
319 // Output files. Empty until the target is resolved. | 329 // Output files. Empty until the target is resolved. |
320 std::vector<OutputFile> computed_outputs_; | 330 std::vector<OutputFile> computed_outputs_; |
321 OutputFile link_output_file_; | 331 OutputFile link_output_file_; |
322 OutputFile dependency_output_file_; | 332 OutputFile dependency_output_file_; |
323 | 333 |
324 DISALLOW_COPY_AND_ASSIGN(Target); | 334 DISALLOW_COPY_AND_ASSIGN(Target); |
325 }; | 335 }; |
326 | 336 |
327 #endif // TOOLS_GN_TARGET_H_ | 337 #endif // TOOLS_GN_TARGET_H_ |
OLD | NEW |