| Index: tools/gn/ninja_binary_target_writer.cc
|
| diff --git a/tools/gn/ninja_binary_target_writer.cc b/tools/gn/ninja_binary_target_writer.cc
|
| index 98c6f1d40771c65d8d1214e9c572a379ffc5e7da..03bc0488cf58b94d2916d874fcaa99e6b5a7c74b 100644
|
| --- a/tools/gn/ninja_binary_target_writer.cc
|
| +++ b/tools/gn/ninja_binary_target_writer.cc
|
| @@ -857,20 +857,25 @@ void NinjaBinaryTargetWriter::WriteLibs() {
|
| // Libraries that have been recursively pushed through the dependency tree.
|
| EscapeOptions lib_escape_opts;
|
| lib_escape_opts.mode = ESCAPE_NINJA_COMMAND;
|
| - const OrderedSet<std::string> all_libs = target_->all_libs();
|
| + const OrderedSet<LibFile> all_libs = target_->all_libs();
|
| const std::string framework_ending(".framework");
|
| for (size_t i = 0; i < all_libs.size(); i++) {
|
| - if (base::EndsWith(all_libs[i], framework_ending,
|
| - base::CompareCase::INSENSITIVE_ASCII)) {
|
| + const LibFile& lib_file = all_libs[i];
|
| + std::string value = lib_file.value();
|
| + if (lib_file.is_source_file()) {
|
| + out_ << " ";
|
| + path_output_.WriteFile(out_, lib_file.source_file());
|
| + } else if (base::EndsWith(value, framework_ending,
|
| + base::CompareCase::INSENSITIVE_ASCII)) {
|
| // Special-case libraries ending in ".framework" to support Mac: Add the
|
| // -framework switch and don't add the extension to the output.
|
| out_ << " -framework ";
|
| - EscapeStringToStream(out_,
|
| - all_libs[i].substr(0, all_libs[i].size() - framework_ending.size()),
|
| + EscapeStringToStream(
|
| + out_, value.substr(0, value.size() - framework_ending.size()),
|
| lib_escape_opts);
|
| } else {
|
| out_ << " " << tool_->lib_switch();
|
| - EscapeStringToStream(out_, all_libs[i], lib_escape_opts);
|
| + EscapeStringToStream(out_, value, lib_escape_opts);
|
| }
|
| }
|
| out_ << std::endl;
|
|
|