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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 void set_output_name(const std::string& name) { output_name_ = name; } | 89 void set_output_name(const std::string& name) { output_name_ = name; } |
90 | 90 |
91 // Returns the output name for this target, which is the output_name if | 91 // Returns the output name for this target, which is the output_name if |
92 // specified, or the target label if not. If the flag is set, it will also | 92 // specified, or the target label if not. If the flag is set, it will also |
93 // include any output prefix specified on the tool (often "lib" on Linux). | 93 // include any output prefix specified on the tool (often "lib" on Linux). |
94 // | 94 // |
95 // Because this depends on the tool for this target, the toolchain must | 95 // Because this depends on the tool for this target, the toolchain must |
96 // have been set before calling. | 96 // have been set before calling. |
97 std::string GetComputedOutputName(bool include_prefix) const; | 97 std::string GetComputedOutputName(bool include_prefix) const; |
98 | 98 |
| 99 bool output_prefix_override() const { return output_prefix_override_; } |
| 100 void set_output_prefix_override(bool prefix_override) { |
| 101 output_prefix_override_ = prefix_override; |
| 102 } |
| 103 |
| 104 // The output extension is really a tri-state: unset (output_extension_set |
| 105 // is false and the string is empty, meaning the default extension should be |
| 106 // used), the output extension is set but empty (output should have no |
| 107 // extension) and the output extension is set but nonempty (use the given |
| 108 // extension). |
99 const std::string& output_extension() const { return output_extension_; } | 109 const std::string& output_extension() const { return output_extension_; } |
100 void set_output_extension(const std::string& extension) { | 110 void set_output_extension(const std::string& extension) { |
101 output_extension_ = extension; | 111 output_extension_ = extension; |
| 112 output_extension_set_ = true; |
| 113 } |
| 114 bool output_extension_set() const { |
| 115 return output_extension_set_; |
102 } | 116 } |
103 | 117 |
104 const FileList& sources() const { return sources_; } | 118 const FileList& sources() const { return sources_; } |
105 FileList& sources() { return sources_; } | 119 FileList& sources() { return sources_; } |
106 | 120 |
107 // Set to true when all sources are public. This is the default. In this case | 121 // Set to true when all sources are public. This is the default. In this case |
108 // the public headers list should be empty. | 122 // the public headers list should be empty. |
109 bool all_headers_public() const { return all_headers_public_; } | 123 bool all_headers_public() const { return all_headers_public_; } |
110 void set_all_headers_public(bool p) { all_headers_public_ = p; } | 124 void set_all_headers_public(bool p) { all_headers_public_ = p; } |
111 | 125 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 // Validates the given thing when a target is resolved. | 325 // Validates the given thing when a target is resolved. |
312 bool CheckVisibility(Err* err) const; | 326 bool CheckVisibility(Err* err) const; |
313 bool CheckTestonly(Err* err) const; | 327 bool CheckTestonly(Err* err) const; |
314 bool CheckNoNestedStaticLibs(Err* err) const; | 328 bool CheckNoNestedStaticLibs(Err* err) const; |
315 bool CheckAssertNoDeps(Err* err) const; | 329 bool CheckAssertNoDeps(Err* err) const; |
316 void CheckSourcesGenerated() const; | 330 void CheckSourcesGenerated() const; |
317 void CheckSourceGenerated(const SourceFile& source) const; | 331 void CheckSourceGenerated(const SourceFile& source) const; |
318 | 332 |
319 OutputType output_type_; | 333 OutputType output_type_; |
320 std::string output_name_; | 334 std::string output_name_; |
| 335 bool output_prefix_override_; |
321 std::string output_extension_; | 336 std::string output_extension_; |
| 337 bool output_extension_set_; |
322 | 338 |
323 FileList sources_; | 339 FileList sources_; |
324 bool all_headers_public_; | 340 bool all_headers_public_; |
325 FileList public_headers_; | 341 FileList public_headers_; |
326 bool check_includes_; | 342 bool check_includes_; |
327 bool complete_static_lib_; | 343 bool complete_static_lib_; |
328 bool testonly_; | 344 bool testonly_; |
329 FileList inputs_; | 345 FileList inputs_; |
330 std::vector<std::string> data_; | 346 std::vector<std::string> data_; |
331 BundleData bundle_data_; | 347 BundleData bundle_data_; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 // Output files. Empty until the target is resolved. | 387 // Output files. Empty until the target is resolved. |
372 std::vector<OutputFile> computed_outputs_; | 388 std::vector<OutputFile> computed_outputs_; |
373 OutputFile link_output_file_; | 389 OutputFile link_output_file_; |
374 OutputFile dependency_output_file_; | 390 OutputFile dependency_output_file_; |
375 OutputFile runtime_link_output_file_; | 391 OutputFile runtime_link_output_file_; |
376 | 392 |
377 DISALLOW_COPY_AND_ASSIGN(Target); | 393 DISALLOW_COPY_AND_ASSIGN(Target); |
378 }; | 394 }; |
379 | 395 |
380 #endif // TOOLS_GN_TARGET_H_ | 396 #endif // TOOLS_GN_TARGET_H_ |
OLD | NEW |