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 <cstring> | 7 #include <cstring> |
8 #include <set> | 8 #include <set> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 void NinjaBinaryTargetWriter::WriteLibs() { | 643 void NinjaBinaryTargetWriter::WriteLibs() { |
644 out_ << " libs ="; | 644 out_ << " libs ="; |
645 | 645 |
646 // Libraries that have been recursively pushed through the dependency tree. | 646 // Libraries that have been recursively pushed through the dependency tree. |
647 EscapeOptions lib_escape_opts; | 647 EscapeOptions lib_escape_opts; |
648 lib_escape_opts.mode = ESCAPE_NINJA_COMMAND; | 648 lib_escape_opts.mode = ESCAPE_NINJA_COMMAND; |
649 const OrderedSet<std::string> all_libs = target_->all_libs(); | 649 const OrderedSet<std::string> all_libs = target_->all_libs(); |
650 const std::string framework_ending(".framework"); | 650 const std::string framework_ending(".framework"); |
651 for (size_t i = 0; i < all_libs.size(); i++) { | 651 for (size_t i = 0; i < all_libs.size(); i++) { |
652 if (settings_->IsMac() && | 652 if (settings_->IsMac() && |
653 base::EndsWith(all_libs[i], framework_ending, false)) { | 653 base::EndsWith(all_libs[i], framework_ending, |
| 654 base::CompareCase::INSENSITIVE_ASCII)) { |
654 // Special-case libraries ending in ".framework" on Mac. Add the | 655 // Special-case libraries ending in ".framework" on Mac. Add the |
655 // -framework switch and don't add the extension to the output. | 656 // -framework switch and don't add the extension to the output. |
656 out_ << " -framework "; | 657 out_ << " -framework "; |
657 EscapeStringToStream(out_, | 658 EscapeStringToStream(out_, |
658 all_libs[i].substr(0, all_libs[i].size() - framework_ending.size()), | 659 all_libs[i].substr(0, all_libs[i].size() - framework_ending.size()), |
659 lib_escape_opts); | 660 lib_escape_opts); |
660 } else { | 661 } else { |
661 out_ << " " << tool_->lib_switch(); | 662 out_ << " " << tool_->lib_switch(); |
662 EscapeStringToStream(out_, all_libs[i], lib_escape_opts); | 663 EscapeStringToStream(out_, all_libs[i], lib_escape_opts); |
663 } | 664 } |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 "\n" | 817 "\n" |
817 "In the latter case, either rename one of the files or move one of\n" | 818 "In the latter case, either rename one of the files or move one of\n" |
818 "the sources to a separate source_set to avoid them both being in\n" | 819 "the sources to a separate source_set to avoid them both being in\n" |
819 "the same target."); | 820 "the same target."); |
820 g_scheduler->FailWithError(err); | 821 g_scheduler->FailWithError(err); |
821 return false; | 822 return false; |
822 } | 823 } |
823 } | 824 } |
824 return true; | 825 return true; |
825 } | 826 } |
OLD | NEW |