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

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

Issue 23766006: GN: Add documentation for gyp command. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: speling Created 7 years, 3 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 | « no previous file | tools/gn/variables.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 <fstream> 5 #include <fstream>
6 6
7 #include "base/atomicops.h" 7 #include "base/atomicops.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 Err(Location(), "GYP execution failed.", output).PrintToStdout(); 143 Err(Location(), "GYP execution failed.", output).PrintToStdout();
144 return false; 144 return false;
145 } 145 }
146 return true; 146 return true;
147 } 147 }
148 148
149 } // namespace 149 } // namespace
150 150
151 const char kGyp[] = "gyp"; 151 const char kGyp[] = "gyp";
152 const char kGyp_HelpShort[] = 152 const char kGyp_HelpShort[] =
153 "gyp: Run gyp and then GN."; 153 "gyp: Run GYP and then GN.";
154 const char kGyp_Help[] = 154 const char kGyp_Help[] =
155 "TODO(brettw) write this.\n"; 155 "gyp: Run GYP and then GN.\n"
156 "\n"
157 " Generate a hybrid GYP/GN build where some targets are generated by\n"
158 " each of the tools. As long as target names and locations match between\n"
159 " the two tools, they can depend on each other.\n"
160 "\n"
161 " When GN is run in this mode, it will not write out any targets\n"
162 " annotated with \"external = true\". Otherwise, GYP targets with the\n"
163 " same name and location will be overwritten.\n"
164 "\n"
165 " References to the GN ninja files will be inserted into the\n"
166 " GYP-generated build.ninja file.\n"
167 "\n"
168 "Option:\n"
169 " --no-gyp\n"
170 " Don't actually run GYP or modify build.ninja. This is used when\n"
171 " working on the GN build when it is known that no GYP files have\n"
172 " changed and you want it to run faster.\n";
156 173
157 // Note: partially duplicated from command_gen.cc. 174 // Note: partially duplicated from command_gen.cc.
158 int RunGyp(const std::vector<std::string>& args) { 175 int RunGyp(const std::vector<std::string>& args) {
159 const CommandLine* cmdline = CommandLine::ForCurrentProcess(); 176 const CommandLine* cmdline = CommandLine::ForCurrentProcess();
160 bool no_gyp = cmdline->HasSwitch(kSwitchNoGyp); 177 bool no_gyp = cmdline->HasSwitch(kSwitchNoGyp);
161 178
162 // Deliberately leaked to avoid expensive process teardown. 179 // Deliberately leaked to avoid expensive process teardown.
163 Setup* setup = new Setup; 180 Setup* setup = new Setup;
164 if (!setup->DoSetup()) 181 if (!setup->DoSetup())
165 return 1; 182 return 1;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 base::IntToString((end_gyp_time - begin_time).InMilliseconds()) + 236 base::IntToString((end_gyp_time - begin_time).InMilliseconds()) +
220 "ms)\n"; 237 "ms)\n";
221 238
222 OutputString(stats); 239 OutputString(stats);
223 } 240 }
224 241
225 return 0; 242 return 0;
226 } 243 }
227 244
228 } // namespace commands 245 } // namespace commands
OLDNEW
« no previous file with comments | « no previous file | tools/gn/variables.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698