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/deps_iterator.h" | 8 #include "tools/gn/deps_iterator.h" |
9 #include "tools/gn/err.h" | 9 #include "tools/gn/err.h" |
10 #include "tools/gn/functions.h" | 10 #include "tools/gn/functions.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 | 48 |
49 if (!FillConfigs()) | 49 if (!FillConfigs()) |
50 return; | 50 return; |
51 | 51 |
52 if (!FillAllowCircularIncludesFrom()) | 52 if (!FillAllowCircularIncludesFrom()) |
53 return; | 53 return; |
54 | 54 |
55 if (!FillCompleteStaticLib()) | 55 if (!FillCompleteStaticLib()) |
56 return; | 56 return; |
57 | 57 |
58 if (!FillDarwinBundle()) | |
59 return; | |
60 | |
58 // Config values (compiler flags, etc.) set directly on this target. | 61 // Config values (compiler flags, etc.) set directly on this target. |
59 ConfigValuesGenerator gen(&target_->config_values(), scope_, | 62 ConfigValuesGenerator gen(&target_->config_values(), scope_, |
60 scope_->GetSourceDir(), err_); | 63 scope_->GetSourceDir(), err_); |
61 gen.Run(); | 64 gen.Run(); |
62 if (err_->has_error()) | 65 if (err_->has_error()) |
63 return; | 66 return; |
64 } | 67 } |
65 | 68 |
66 bool BinaryTargetGenerator::FillCompleteStaticLib() { | 69 bool BinaryTargetGenerator::FillCompleteStaticLib() { |
67 if (target_->output_type() == Target::STATIC_LIBRARY) { | 70 if (target_->output_type() == Target::STATIC_LIBRARY) { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 "deps."); | 127 "deps."); |
125 return false; | 128 return false; |
126 } | 129 } |
127 } | 130 } |
128 | 131 |
129 // Add to the set. | 132 // Add to the set. |
130 for (const auto& cur : circular) | 133 for (const auto& cur : circular) |
131 target_->allow_circular_includes_from().insert(cur); | 134 target_->allow_circular_includes_from().insert(cur); |
132 return true; | 135 return true; |
133 } | 136 } |
137 | |
138 bool BinaryTargetGenerator::FillDarwinBundle() { | |
139 // This flag only applies to executable, shared_library, and loadable_module | |
140 // target types. | |
141 if (target_->output_type() == Target::STATIC_LIBRARY) | |
brettw
2015/10/13 22:59:07
This code should also be run for source sets. I th
Bons
2015/10/13 23:12:47
removed so non-issue.
| |
142 return true; | |
143 | |
144 const Value* value = scope_->GetValue(variables::kDarwinBundle, true); | |
145 if (value) { | |
146 if (!value->VerifyTypeIs(Value::BOOLEAN, err_)) | |
147 return false; | |
148 target_->set_darwin_bundle(value->boolean_value()); | |
149 } | |
150 return true; | |
151 } | |
OLD | NEW |