OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |