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

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

Issue 26561005: GYP generator for GN (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « tools/gn/ninja_binary_target_writer.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_build_writer.h" 5 #include "tools/gn/ninja_build_writer.h"
6 6
7 #include <fstream> 7 #include <fstream>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 NinjaBuildWriter gen(build_settings, all_settings, 116 NinjaBuildWriter gen(build_settings, all_settings,
117 default_toolchain_targets, file, depfile); 117 default_toolchain_targets, file, depfile);
118 gen.Run(); 118 gen.Run();
119 return true; 119 return true;
120 } 120 }
121 121
122 void NinjaBuildWriter::WriteNinjaRules() { 122 void NinjaBuildWriter::WriteNinjaRules() {
123 out_ << "rule gn\n"; 123 out_ << "rule gn\n";
124 out_ << " command = " << GetSelfInvocationCommand(build_settings_) << "\n"; 124 out_ << " command = " << GetSelfInvocationCommand(build_settings_) << "\n";
125 out_ << " description = GN the world\n\n"; 125 out_ << " description = Regenerating ninja files\n\n";
126 126
127 out_ << "build build.ninja: gn\n" 127 out_ << "build build.ninja: gn\n"
128 << " depfile = build.ninja.d\n"; 128 << " depfile = build.ninja.d\n";
129 129
130 // Input build files. These go in the ".d" file. If we write them as 130 // Input build files. These go in the ".d" file. If we write them as
131 // dependencies in the .ninja file itself, ninja will expect the files to 131 // dependencies in the .ninja file itself, ninja will expect the files to
132 // exist and will error if they don't. When files are listed in a depfile, 132 // exist and will error if they don't. When files are listed in a depfile,
133 // missing files are ignored. 133 // missing files are ignored.
134 dep_out_ << "build.ninja:"; 134 dep_out_ << "build.ninja:";
135 std::vector<base::FilePath> input_files; 135 std::vector<base::FilePath> input_files;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 all_rules.append(" $\n "); 174 all_rules.append(" $\n ");
175 all_rules.append(target_file.value()); 175 all_rules.append(target_file.value());
176 } 176 }
177 177
178 if (!all_rules.empty()) { 178 if (!all_rules.empty()) {
179 out_ << "\nbuild all: phony " << all_rules << std::endl; 179 out_ << "\nbuild all: phony " << all_rules << std::endl;
180 out_ << "default all" << std::endl; 180 out_ << "default all" << std::endl;
181 } 181 }
182 } 182 }
183 183
OLDNEW
« no previous file with comments | « tools/gn/ninja_binary_target_writer.cc ('k') | tools/gn/ninja_target_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698