Chromium Code Reviews| 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 "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "tools/gn/config_values_extractors.h" | 10 #include "tools/gn/config_values_extractors.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 237 if (dep->output_type() == STATIC_LIBRARY || | 237 if (dep->output_type() == STATIC_LIBRARY || |
| 238 dep->output_type() == SHARED_LIBRARY || | 238 dep->output_type() == SHARED_LIBRARY || |
| 239 dep->output_type() == SOURCE_SET) | 239 dep->output_type() == SOURCE_SET) |
| 240 inherited_libraries_.push_back(dep); | 240 inherited_libraries_.push_back(dep); |
| 241 | 241 |
| 242 // Inherited libraries and flags are inherited across static library | 242 // Inherited libraries and flags are inherited across static library |
| 243 // boundaries. | 243 // boundaries. |
| 244 if (!dep->IsFinal()) { | 244 if (!dep->IsFinal()) { |
| 245 inherited_libraries_.Append(dep->inherited_libraries().begin(), | 245 inherited_libraries_.Append(dep->inherited_libraries().begin(), |
| 246 dep->inherited_libraries().end()); | 246 dep->inherited_libraries().end()); |
| 247 } else if (dep->complete_static_lib()) { | |
|
brettw
2014/09/16 16:46:02
I don't think there should have to be a separate s
brettw
2014/09/16 23:56:12
I get what's happening here. Can you add a comment
kal
2014/09/17 05:03:54
OK I will extend the comment here.
The way its im
| |
| 248 // Inherit final libraries through _complete_ static libraries. | |
| 249 for (size_t i = 0; i < dep->inherited_libraries().size(); i++) { | |
| 250 const Target* inherited = dep->inherited_libraries()[i]; | |
| 251 if (inherited->IsFinal()) | |
| 252 inherited_libraries_.push_back(inherited); | |
| 253 } | |
| 254 } | |
| 247 | 255 |
| 248 // Inherited library settings. | 256 // Library settings are always inherited across static library boundaries. |
| 257 if (!dep->IsFinal() || dep->output_type() == STATIC_LIBRARY) { | |
| 249 all_lib_dirs_.append(dep->all_lib_dirs()); | 258 all_lib_dirs_.append(dep->all_lib_dirs()); |
| 250 all_libs_.append(dep->all_libs()); | 259 all_libs_.append(dep->all_libs()); |
| 251 } | 260 } |
| 252 } | 261 } |
| 253 } | 262 } |
| 254 | 263 |
| 255 void Target::PullForwardedDependentConfigs() { | 264 void Target::PullForwardedDependentConfigs() { |
| 256 // Groups implicitly forward all if its dependency's configs. | 265 // Groups implicitly forward all if its dependency's configs. |
| 257 if (output_type() == GROUP) { | 266 if (output_type() == GROUP) { |
| 258 for (size_t i = 0; i < deps_.size(); i++) | 267 for (size_t i = 0; i < deps_.size(); i++) |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 386 | 395 |
| 387 for (size_t i = 0; i < datadeps_.size(); i++) { | 396 for (size_t i = 0; i < datadeps_.size(); i++) { |
| 388 if (datadeps_[i].ptr->testonly()) { | 397 if (datadeps_[i].ptr->testonly()) { |
| 389 *err = MakeTestOnlyError(this, datadeps_[i].ptr); | 398 *err = MakeTestOnlyError(this, datadeps_[i].ptr); |
| 390 return false; | 399 return false; |
| 391 } | 400 } |
| 392 } | 401 } |
| 393 | 402 |
| 394 return true; | 403 return true; |
| 395 } | 404 } |
| OLD | NEW |