Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(625)

Side by Side Diff: tools/gn/ninja_binary_target_writer.cc

Issue 1431323003: Remove obsolete OS handling in GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 853
854 void NinjaBinaryTargetWriter::WriteLibs() { 854 void NinjaBinaryTargetWriter::WriteLibs() {
855 out_ << " libs ="; 855 out_ << " libs =";
856 856
857 // Libraries that have been recursively pushed through the dependency tree. 857 // Libraries that have been recursively pushed through the dependency tree.
858 EscapeOptions lib_escape_opts; 858 EscapeOptions lib_escape_opts;
859 lib_escape_opts.mode = ESCAPE_NINJA_COMMAND; 859 lib_escape_opts.mode = ESCAPE_NINJA_COMMAND;
860 const OrderedSet<std::string> all_libs = target_->all_libs(); 860 const OrderedSet<std::string> all_libs = target_->all_libs();
861 const std::string framework_ending(".framework"); 861 const std::string framework_ending(".framework");
862 for (size_t i = 0; i < all_libs.size(); i++) { 862 for (size_t i = 0; i < all_libs.size(); i++) {
863 if (settings_->IsMac() && 863 if (base::EndsWith(all_libs[i], framework_ending,
864 base::EndsWith(all_libs[i], framework_ending,
865 base::CompareCase::INSENSITIVE_ASCII)) { 864 base::CompareCase::INSENSITIVE_ASCII)) {
866 // Special-case libraries ending in ".framework" on Mac. Add the 865 // Special-case libraries ending in ".framework" to support Mac: Add the
867 // -framework switch and don't add the extension to the output. 866 // -framework switch and don't add the extension to the output.
868 out_ << " -framework "; 867 out_ << " -framework ";
869 EscapeStringToStream(out_, 868 EscapeStringToStream(out_,
870 all_libs[i].substr(0, all_libs[i].size() - framework_ending.size()), 869 all_libs[i].substr(0, all_libs[i].size() - framework_ending.size()),
871 lib_escape_opts); 870 lib_escape_opts);
872 } else { 871 } else {
873 out_ << " " << tool_->lib_switch(); 872 out_ << " " << tool_->lib_switch();
874 EscapeStringToStream(out_, all_libs[i], lib_escape_opts); 873 EscapeStringToStream(out_, all_libs[i], lib_escape_opts);
875 } 874 }
876 } 875 }
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 "\n" 1027 "\n"
1029 "In the latter case, either rename one of the files or move one of\n" 1028 "In the latter case, either rename one of the files or move one of\n"
1030 "the sources to a separate source_set to avoid them both being in\n" 1029 "the sources to a separate source_set to avoid them both being in\n"
1031 "the same target."); 1030 "the same target.");
1032 g_scheduler->FailWithError(err); 1031 g_scheduler->FailWithError(err);
1033 return false; 1032 return false;
1034 } 1033 }
1035 } 1034 }
1036 return true; 1035 return true;
1037 } 1036 }
OLDNEW
« no previous file with comments | « tools/gn/ninja_action_target_writer_unittest.cc ('k') | tools/gn/ninja_binary_target_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698