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 #include "tools/gn/binary_target_generator.h" | 5 #include "tools/gn/binary_target_generator.h" |
6 | 6 |
7 #include "tools/gn/config_values_generator.h" | 7 #include "tools/gn/config_values_generator.h" |
8 #include "tools/gn/err.h" | 8 #include "tools/gn/err.h" |
9 #include "tools/gn/functions.h" | 9 #include "tools/gn/functions.h" |
10 #include "tools/gn/scope.h" | 10 #include "tools/gn/scope.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 return; | 52 return; |
53 | 53 |
54 FillConfigs(); | 54 FillConfigs(); |
55 if (err_->has_error()) | 55 if (err_->has_error()) |
56 return; | 56 return; |
57 | 57 |
58 FillAllowCircularIncludesFrom(); | 58 FillAllowCircularIncludesFrom(); |
59 if (err_->has_error()) | 59 if (err_->has_error()) |
60 return; | 60 return; |
61 | 61 |
| 62 FillCompleteStaticLib(); |
| 63 if (err_->has_error()) |
| 64 return; |
| 65 |
62 // Config values (compiler flags, etc.) set directly on this target. | 66 // Config values (compiler flags, etc.) set directly on this target. |
63 ConfigValuesGenerator gen(&target_->config_values(), scope_, | 67 ConfigValuesGenerator gen(&target_->config_values(), scope_, |
64 scope_->GetSourceDir(), err_); | 68 scope_->GetSourceDir(), err_); |
65 gen.Run(); | 69 gen.Run(); |
66 if (err_->has_error()) | 70 if (err_->has_error()) |
67 return; | 71 return; |
68 } | 72 } |
69 | 73 |
70 void BinaryTargetGenerator::FillCheckIncludes() { | 74 void BinaryTargetGenerator::FillCheckIncludes() { |
71 const Value* value = scope_->GetValue(variables::kCheckIncludes, true); | 75 const Value* value = scope_->GetValue(variables::kCheckIncludes, true); |
72 if (!value) | 76 if (!value) |
73 return; | 77 return; |
74 if (!value->VerifyTypeIs(Value::BOOLEAN, err_)) | 78 if (!value->VerifyTypeIs(Value::BOOLEAN, err_)) |
75 return; | 79 return; |
76 target_->set_check_includes(value->boolean_value()); | 80 target_->set_check_includes(value->boolean_value()); |
77 } | 81 } |
78 | 82 |
| 83 void BinaryTargetGenerator::FillCompleteStaticLib() { |
| 84 if (target_->output_type() == Target::STATIC_LIBRARY) { |
| 85 const Value* value = scope_->GetValue(variables::kCompleteStaticLib, true); |
| 86 if (!value) |
| 87 return; |
| 88 if (!value->VerifyTypeIs(Value::BOOLEAN, err_)) |
| 89 return; |
| 90 target_->set_complete_static_lib(value->boolean_value()); |
| 91 } |
| 92 } |
| 93 |
79 void BinaryTargetGenerator::FillOutputName() { | 94 void BinaryTargetGenerator::FillOutputName() { |
80 const Value* value = scope_->GetValue(variables::kOutputName, true); | 95 const Value* value = scope_->GetValue(variables::kOutputName, true); |
81 if (!value) | 96 if (!value) |
82 return; | 97 return; |
83 if (!value->VerifyTypeIs(Value::STRING, err_)) | 98 if (!value->VerifyTypeIs(Value::STRING, err_)) |
84 return; | 99 return; |
85 target_->set_output_name(value->string_value()); | 100 target_->set_output_name(value->string_value()); |
86 } | 101 } |
87 | 102 |
88 void BinaryTargetGenerator::FillOutputExtension() { | 103 void BinaryTargetGenerator::FillOutputExtension() { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 "allow_circular_includes_from only allows\ntargets present in the " | 138 "allow_circular_includes_from only allows\ntargets present in the " |
124 "deps."); | 139 "deps."); |
125 return; | 140 return; |
126 } | 141 } |
127 } | 142 } |
128 | 143 |
129 // Add to the set. | 144 // Add to the set. |
130 for (size_t i = 0; i < circular.size(); i++) | 145 for (size_t i = 0; i < circular.size(); i++) |
131 target_->allow_circular_includes_from().insert(circular[i]); | 146 target_->allow_circular_includes_from().insert(circular[i]); |
132 } | 147 } |
OLD | NEW |