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

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

Issue 1182183003: Move EndsWith to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months 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
« no previous file with comments | « third_party/zlib/google/zip_reader.cc ('k') | tools/gn/ninja_target_writer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <set> 7 #include <set>
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 329
330 void NinjaBinaryTargetWriter::WriteLibs() { 330 void NinjaBinaryTargetWriter::WriteLibs() {
331 out_ << " libs ="; 331 out_ << " libs =";
332 332
333 // Libraries that have been recursively pushed through the dependency tree. 333 // Libraries that have been recursively pushed through the dependency tree.
334 EscapeOptions lib_escape_opts; 334 EscapeOptions lib_escape_opts;
335 lib_escape_opts.mode = ESCAPE_NINJA_COMMAND; 335 lib_escape_opts.mode = ESCAPE_NINJA_COMMAND;
336 const OrderedSet<std::string> all_libs = target_->all_libs(); 336 const OrderedSet<std::string> all_libs = target_->all_libs();
337 const std::string framework_ending(".framework"); 337 const std::string framework_ending(".framework");
338 for (size_t i = 0; i < all_libs.size(); i++) { 338 for (size_t i = 0; i < all_libs.size(); i++) {
339 if (settings_->IsMac() && EndsWith(all_libs[i], framework_ending, false)) { 339 if (settings_->IsMac() &&
340 base::EndsWith(all_libs[i], framework_ending, false)) {
340 // Special-case libraries ending in ".framework" on Mac. Add the 341 // Special-case libraries ending in ".framework" on Mac. Add the
341 // -framework switch and don't add the extension to the output. 342 // -framework switch and don't add the extension to the output.
342 out_ << " -framework "; 343 out_ << " -framework ";
343 EscapeStringToStream(out_, 344 EscapeStringToStream(out_,
344 all_libs[i].substr(0, all_libs[i].size() - framework_ending.size()), 345 all_libs[i].substr(0, all_libs[i].size() - framework_ending.size()),
345 lib_escape_opts); 346 lib_escape_opts);
346 } else { 347 } else {
347 out_ << " " << tool_->lib_switch(); 348 out_ << " " << tool_->lib_switch();
348 EscapeStringToStream(out_, all_libs[i], lib_escape_opts); 349 EscapeStringToStream(out_, all_libs[i], lib_escape_opts);
349 } 350 }
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 return false; // No tool for this file (it's a header file or something). 504 return false; // No tool for this file (it's a header file or something).
504 const Tool* tool = target->toolchain()->GetTool(*computed_tool_type); 505 const Tool* tool = target->toolchain()->GetTool(*computed_tool_type);
505 if (!tool) 506 if (!tool)
506 return false; // Tool does not apply for this toolchain.file. 507 return false; // Tool does not apply for this toolchain.file.
507 508
508 // Figure out what output(s) this compiler produces. 509 // Figure out what output(s) this compiler produces.
509 SubstitutionWriter::ApplyListToCompilerAsOutputFile( 510 SubstitutionWriter::ApplyListToCompilerAsOutputFile(
510 target, source, tool->outputs(), outputs); 511 target, source, tool->outputs(), outputs);
511 return !outputs->empty(); 512 return !outputs->empty();
512 } 513 }
OLDNEW
« no previous file with comments | « third_party/zlib/google/zip_reader.cc ('k') | tools/gn/ninja_target_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698