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/target.h" | 5 #include "tools/gn/target.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "tools/gn/config_values_extractors.h" | 8 #include "tools/gn/config_values_extractors.h" |
9 #include "tools/gn/scheduler.h" | 9 #include "tools/gn/scheduler.h" |
10 | 10 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 void Target::PullDependentTargetInfo(std::set<const Config*>* unique_configs) { | 181 void Target::PullDependentTargetInfo(std::set<const Config*>* unique_configs) { |
182 // Gather info from our dependents we need. | 182 // Gather info from our dependents we need. |
183 for (size_t dep_i = 0; dep_i < deps_.size(); dep_i++) { | 183 for (size_t dep_i = 0; dep_i < deps_.size(); dep_i++) { |
184 const Target* dep = deps_[dep_i]; | 184 const Target* dep = deps_[dep_i]; |
185 MergeAllDependentConfigsFrom(dep, unique_configs, &configs_, | 185 MergeAllDependentConfigsFrom(dep, unique_configs, &configs_, |
186 &all_dependent_configs_); | 186 &all_dependent_configs_); |
187 MergeDirectDependentConfigsFrom(dep, unique_configs, &configs_); | 187 MergeDirectDependentConfigsFrom(dep, unique_configs, &configs_); |
188 | 188 |
189 // Direct dependent libraries. | 189 // Direct dependent libraries. |
190 if (dep->output_type() == STATIC_LIBRARY || | 190 if (dep->output_type() == STATIC_LIBRARY || |
191 dep->output_type() == SHARED_LIBRARY) | 191 dep->output_type() == SHARED_LIBRARY || |
| 192 dep->output_type() == SOURCE_SET) |
192 inherited_libraries_.insert(dep); | 193 inherited_libraries_.insert(dep); |
193 | 194 |
194 // Inherited libraries and flags are inherited across static library | 195 // Inherited libraries and flags are inherited across static library |
195 // boundaries. For external targets, assume that the external_link_deps | 196 // boundaries. For external targets, assume that the external_link_deps |
196 // will take care of this. | 197 // will take care of this. |
197 if ((!dep->external() || | 198 if ((!dep->external() || |
198 !settings()->build_settings()->using_external_generator()) && | 199 !settings()->build_settings()->using_external_generator()) && |
199 dep->output_type() != SHARED_LIBRARY && | 200 dep->output_type() != SHARED_LIBRARY && |
200 dep->output_type() != EXECUTABLE) { | 201 dep->output_type() != EXECUTABLE) { |
201 const std::set<const Target*> inherited = dep->inherited_libraries(); | 202 const std::set<const Target*> inherited = dep->inherited_libraries(); |
(...skipping 14 matching lines...) Expand all Loading... |
216 // The forward_dependent_configs_ must be in the deps already, so we | 217 // The forward_dependent_configs_ must be in the deps already, so we |
217 // don't need to bother copying to our configs, only forwarding. | 218 // don't need to bother copying to our configs, only forwarding. |
218 DCHECK(std::find(deps_.begin(), deps_.end(), from_target) != | 219 DCHECK(std::find(deps_.begin(), deps_.end(), from_target) != |
219 deps_.end()); | 220 deps_.end()); |
220 const std::vector<const Config*>& direct = | 221 const std::vector<const Config*>& direct = |
221 from_target->direct_dependent_configs(); | 222 from_target->direct_dependent_configs(); |
222 for (size_t i = 0; i < direct.size(); i++) | 223 for (size_t i = 0; i < direct.size(); i++) |
223 direct_dependent_configs_.push_back(direct[i]); | 224 direct_dependent_configs_.push_back(direct[i]); |
224 } | 225 } |
225 } | 226 } |
OLD | NEW |