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

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

Issue 1386783003: [GN]: Support for loadable modules (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
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->output_type() == Target::EXECUTABLE ||
71 target->output_type() == Target::LOADABLE_MODULE ||
71 target->output_type() == Target::STATIC_LIBRARY || 72 target->output_type() == Target::STATIC_LIBRARY ||
72 target->output_type() == Target::SHARED_LIBRARY || 73 target->output_type() == Target::SHARED_LIBRARY ||
73 target->output_type() == Target::SOURCE_SET) { 74 target->output_type() == Target::SOURCE_SET) {
74 NinjaBinaryTargetWriter writer(target, file); 75 NinjaBinaryTargetWriter writer(target, file);
75 writer.Run(); 76 writer.Run();
76 } else { 77 } else {
77 CHECK(0); 78 CHECK(0) << "Output type of target not handled.";
78 } 79 }
79 80
80 std::string contents = file.str(); 81 std::string contents = file.str();
81 base::WriteFile(ninja_file, contents.c_str(), 82 base::WriteFile(ninja_file, contents.c_str(),
82 static_cast<int>(contents.size())); 83 static_cast<int>(contents.size()));
83 } 84 }
84 85
85 void NinjaTargetWriter::WriteSharedVars(const SubstitutionBits& bits) { 86 void NinjaTargetWriter::WriteSharedVars(const SubstitutionBits& bits) {
86 bool written_anything = false; 87 bool written_anything = false;
87 88
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 << GetNinjaRulePrefixForToolchain(settings_) 256 << GetNinjaRulePrefixForToolchain(settings_)
256 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); 257 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP);
257 path_output_.WriteFiles(out_, files); 258 path_output_.WriteFiles(out_, files);
258 259
259 if (!order_only_deps.empty()) { 260 if (!order_only_deps.empty()) {
260 out_ << " ||"; 261 out_ << " ||";
261 path_output_.WriteFiles(out_, order_only_deps); 262 path_output_.WriteFiles(out_, order_only_deps);
262 } 263 }
263 out_ << std::endl; 264 out_ << std::endl;
264 } 265 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698