| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 dep->output_type() == SHARED_LIBRARY || | 170 dep->output_type() == SHARED_LIBRARY || |
| 171 dep->output_type() == SOURCE_SET) | 171 dep->output_type() == SOURCE_SET) |
| 172 inherited_libraries_.insert(dep); | 172 inherited_libraries_.insert(dep); |
| 173 | 173 |
| 174 // Inherited libraries and flags are inherited across static library | 174 // Inherited libraries and flags are inherited across static library |
| 175 // boundaries. | 175 // boundaries. |
| 176 if (dep->output_type() != SHARED_LIBRARY && | 176 if (dep->output_type() != SHARED_LIBRARY && |
| 177 dep->output_type() != EXECUTABLE) { | 177 dep->output_type() != EXECUTABLE) { |
| 178 const std::set<const Target*> inherited = dep->inherited_libraries(); | 178 const std::set<const Target*> inherited = dep->inherited_libraries(); |
| 179 for (std::set<const Target*>::const_iterator i = inherited.begin(); | 179 for (std::set<const Target*>::const_iterator i = inherited.begin(); |
| 180 i != inherited.end(); ++i) { | 180 i != inherited.end(); ++i) |
| 181 // Don't copy source sets across static library boundaries. The static | 181 inherited_libraries_.insert(*i); |
| 182 // library will include all the files from the source set. | |
| 183 if (!(dep->output_type() == STATIC_LIBRARY && | |
| 184 (*i)->output_type() == SOURCE_SET)) | |
| 185 inherited_libraries_.insert(*i); | |
| 186 } | |
| 187 | 182 |
| 188 // Inherited library settings. | 183 // Inherited library settings. |
| 189 all_lib_dirs_.append(dep->all_lib_dirs()); | 184 all_lib_dirs_.append(dep->all_lib_dirs()); |
| 190 all_libs_.append(dep->all_libs()); | 185 all_libs_.append(dep->all_libs()); |
| 191 } | 186 } |
| 192 } | 187 } |
| 193 } | 188 } |
| 194 | 189 |
| 195 void Target::PullForwardedDependentConfigs() { | 190 void Target::PullForwardedDependentConfigs() { |
| 196 // Groups implicitly forward all if its dependency's configs. | 191 // Groups implicitly forward all if its dependency's configs. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 221 | 216 |
| 222 // Android STL doesn't like insert(begin, end) so do it manually. | 217 // Android STL doesn't like insert(begin, end) so do it manually. |
| 223 // TODO(brettw) this can be changed to insert(dep->begin(), dep->end()) when | 218 // TODO(brettw) this can be changed to insert(dep->begin(), dep->end()) when |
| 224 // Android uses a better STL. | 219 // Android uses a better STL. |
| 225 for (std::set<const Target*>::const_iterator cur = | 220 for (std::set<const Target*>::const_iterator cur = |
| 226 dep->recursive_hard_deps().begin(); | 221 dep->recursive_hard_deps().begin(); |
| 227 cur != dep->recursive_hard_deps().end(); ++cur) | 222 cur != dep->recursive_hard_deps().end(); ++cur) |
| 228 recursive_hard_deps_.insert(*cur); | 223 recursive_hard_deps_.insert(*cur); |
| 229 } | 224 } |
| 230 } | 225 } |
| OLD | NEW |