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

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

Issue 558763002: Require build directories exist for some GN commands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: file path literal Created 6 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
« no previous file with comments | « tools/gn/command_desc.cc ('k') | tools/gn/command_ls.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 "base/atomicops.h" 5 #include "base/atomicops.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/timer/elapsed_timer.h" 9 #include "base/timer/elapsed_timer.h"
10 #include "tools/gn/build_settings.h" 10 #include "tools/gn/build_settings.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 if (args.size() != 1) { 71 if (args.size() != 1) {
72 Err(Location(), "Need exactly one build directory to generate.", 72 Err(Location(), "Need exactly one build directory to generate.",
73 "I expected something more like \"gn gen out/foo\"\n" 73 "I expected something more like \"gn gen out/foo\"\n"
74 "You can also see \"gn help gen\".").PrintToStdout(); 74 "You can also see \"gn help gen\".").PrintToStdout();
75 return 1; 75 return 1;
76 } 76 }
77 77
78 // Deliberately leaked to avoid expensive process teardown. 78 // Deliberately leaked to avoid expensive process teardown.
79 Setup* setup = new Setup(); 79 Setup* setup = new Setup();
80 if (!setup->DoSetup(args[0])) 80 if (!setup->DoSetup(args[0], true))
81 return 1; 81 return 1;
82 82
83 if (CommandLine::ForCurrentProcess()->HasSwitch(kSwitchCheck)) 83 if (CommandLine::ForCurrentProcess()->HasSwitch(kSwitchCheck))
84 setup->set_check_public_headers(true); 84 setup->set_check_public_headers(true);
85 85
86 // Cause the load to also generate the ninja files for each target. We wrap 86 // Cause the load to also generate the ninja files for each target. We wrap
87 // the writing to maintain a counter. 87 // the writing to maintain a counter.
88 base::subtle::Atomic32 write_counter = 0; 88 base::subtle::Atomic32 write_counter = 0;
89 setup->builder()->set_resolved_callback( 89 setup->builder()->set_resolved_callback(
90 base::Bind(&ItemResolvedCallback, &write_counter, 90 base::Bind(&ItemResolvedCallback, &write_counter,
(...skipping 20 matching lines...) Expand all
111 setup->scheduler().input_file_manager()->GetInputFileCount()) + 111 setup->scheduler().input_file_manager()->GetInputFileCount()) +
112 " files in " + 112 " files in " +
113 base::IntToString(elapsed_time.InMilliseconds()) + "ms\n"; 113 base::IntToString(elapsed_time.InMilliseconds()) + "ms\n";
114 OutputString(stats); 114 OutputString(stats);
115 } 115 }
116 116
117 return 0; 117 return 0;
118 } 118 }
119 119
120 } // namespace commands 120 } // namespace commands
OLDNEW
« no previous file with comments | « tools/gn/command_desc.cc ('k') | tools/gn/command_ls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698