| 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/ninja_binary_target_writer.h" | 5 #include "tools/gn/ninja_binary_target_writer.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "tools/gn/config_values_extractors.h" | 10 #include "tools/gn/config_values_extractors.h" |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 out_ << " "; | 326 out_ << " "; |
| 327 path_output_.WriteFile(out_, *i); | 327 path_output_.WriteFile(out_, *i); |
| 328 } | 328 } |
| 329 | 329 |
| 330 // Libs. | 330 // Libs. |
| 331 for (size_t i = 0; i < linkable_deps.size(); i++) { | 331 for (size_t i = 0; i < linkable_deps.size(); i++) { |
| 332 out_ << " "; | 332 out_ << " "; |
| 333 path_output_.WriteFile(out_, helper_.GetTargetOutputFile(linkable_deps[i])); | 333 path_output_.WriteFile(out_, helper_.GetTargetOutputFile(linkable_deps[i])); |
| 334 } | 334 } |
| 335 | 335 |
| 336 // External link deps from GYP. This is indexed by a label with no toolchain. | |
| 337 typedef BuildSettings::AdditionalLibsMap LibsMap; | |
| 338 const LibsMap& libs = settings_->build_settings()->external_link_deps(); | |
| 339 Label libs_key(target_->label().dir(), target_->label().name()); | |
| 340 LibsMap::const_iterator libs_end = libs.upper_bound(libs_key); | |
| 341 for (LibsMap::const_iterator i = libs.lower_bound(libs_key); | |
| 342 i != libs_end; ++i) { | |
| 343 out_ << " "; | |
| 344 path_output_.WriteFile(out_, i->second); | |
| 345 } | |
| 346 | |
| 347 // Append data dependencies as implicit dependencies. | 336 // Append data dependencies as implicit dependencies. |
| 348 WriteImplicitDependencies(non_linkable_deps); | 337 WriteImplicitDependencies(non_linkable_deps); |
| 349 | 338 |
| 350 out_ << std::endl; | 339 out_ << std::endl; |
| 351 } | 340 } |
| 352 | 341 |
| 353 void NinjaBinaryTargetWriter::WriteSourceSetStamp( | 342 void NinjaBinaryTargetWriter::WriteSourceSetStamp( |
| 354 const std::vector<OutputFile>& object_files) { | 343 const std::vector<OutputFile>& object_files) { |
| 355 // The stamp rule for source sets is generally not used, since targets that | 344 // The stamp rule for source sets is generally not used, since targets that |
| 356 // depend on this will reference the object files directly. However, writing | 345 // depend on this will reference the object files directly. However, writing |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 } | 454 } |
| 466 | 455 |
| 467 // Data files. | 456 // Data files. |
| 468 const std::vector<SourceFile>& data = target_->data(); | 457 const std::vector<SourceFile>& data = target_->data(); |
| 469 for (size_t i = 0; i < data.size(); i++) { | 458 for (size_t i = 0; i < data.size(); i++) { |
| 470 out_ << " "; | 459 out_ << " "; |
| 471 path_output_.WriteFile(out_, data[i]); | 460 path_output_.WriteFile(out_, data[i]); |
| 472 } | 461 } |
| 473 } | 462 } |
| 474 } | 463 } |
| OLD | NEW |