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

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

Issue 1607423002: Allow .o files for GN generated inputs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment fix Created 4 years, 11 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 | « tools/gn/ninja_binary_target_writer.cc ('k') | tools/gn/target.h » ('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_target_writer.h" 5 #include "tools/gn/ninja_target_writer.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 if (target->output_type() == Target::COPY_FILES) { 60 if (target->output_type() == Target::COPY_FILES) {
61 NinjaCopyTargetWriter writer(target, file); 61 NinjaCopyTargetWriter writer(target, file);
62 writer.Run(); 62 writer.Run();
63 } else if (target->output_type() == Target::ACTION || 63 } else if (target->output_type() == Target::ACTION ||
64 target->output_type() == Target::ACTION_FOREACH) { 64 target->output_type() == Target::ACTION_FOREACH) {
65 NinjaActionTargetWriter writer(target, file); 65 NinjaActionTargetWriter writer(target, file);
66 writer.Run(); 66 writer.Run();
67 } else if (target->output_type() == Target::GROUP) { 67 } else if (target->output_type() == Target::GROUP) {
68 NinjaGroupTargetWriter writer(target, file); 68 NinjaGroupTargetWriter writer(target, file);
69 writer.Run(); 69 writer.Run();
70 } else if (target->output_type() == Target::EXECUTABLE || 70 } else if (target->IsBinary()) {
71 target->output_type() == Target::LOADABLE_MODULE ||
72 target->output_type() == Target::STATIC_LIBRARY ||
73 target->output_type() == Target::SHARED_LIBRARY ||
74 target->output_type() == Target::SOURCE_SET) {
75 NinjaBinaryTargetWriter writer(target, file); 71 NinjaBinaryTargetWriter writer(target, file);
76 writer.Run(); 72 writer.Run();
77 } else { 73 } else {
78 CHECK(0) << "Output type of target not handled."; 74 CHECK(0) << "Output type of target not handled.";
79 } 75 }
80 76
81 std::string contents = file.str(); 77 std::string contents = file.str();
82 base::WriteFile(ninja_file, contents.c_str(), 78 base::WriteFile(ninja_file, contents.c_str(),
83 static_cast<int>(contents.size())); 79 static_cast<int>(contents.size()));
84 } 80 }
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 << GetNinjaRulePrefixForToolchain(settings_) 267 << GetNinjaRulePrefixForToolchain(settings_)
272 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); 268 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP);
273 path_output_.WriteFiles(out_, files); 269 path_output_.WriteFiles(out_, files);
274 270
275 if (!order_only_deps.empty()) { 271 if (!order_only_deps.empty()) {
276 out_ << " ||"; 272 out_ << " ||";
277 path_output_.WriteFiles(out_, order_only_deps); 273 path_output_.WriteFiles(out_, order_only_deps);
278 } 274 }
279 out_ << std::endl; 275 out_ << std::endl;
280 } 276 }
OLDNEW
« no previous file with comments | « tools/gn/ninja_binary_target_writer.cc ('k') | tools/gn/target.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698