OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "tools/gn/commands.h" | |
6 #include "tools/gn/setup.h" | |
7 #include "tools/gn/standard_out.h" | |
8 | |
9 namespace commands { | |
10 | |
11 const char kCheck[] = "check"; | |
12 const char kCheck_HelpShort[] = | |
13 "check: Check header dependencies."; | |
14 const char kCheck_Help[] = | |
15 "gn check: Check header dependencies.\n" | |
16 "\n" | |
17 " \"gn check\" is the same thing as \"gn gen\" with the \"--check\" flag\n" | |
18 " except that this command does not write out any build files. It's\n" | |
19 " intended to be an easy way to manually trigger include file checking.\n" | |
20 "\n" | |
21 " See \"gn help\" for the common command-line switches.\n"; | |
22 | |
23 // Note: partially duplicated in command_gyp.cc. | |
24 int RunCheck(const std::vector<std::string>& args) { | |
25 // Deliberately leaked to avoid expensive process teardown. | |
26 Setup* setup = new Setup(); | |
27 // TODO(brettw) bug 343726: Use a temporary directory instead of this | |
28 // default one to avoid messing up any build that's in there. | |
29 if (!setup->DoSetup("//out/Default")) | |
scottmg
2014/04/05 00:40:07
//out/Check instead?
brettw
2014/04/07 05:08:19
I'm currently using this for all the "temporary" g
| |
30 return 1; | |
31 setup->set_check_public_headers(true); | |
32 | |
33 if (!setup->Run()) | |
34 return 1; | |
35 | |
36 OutputString("Header dependency check OK\n", DECORATION_GREEN); | |
37 return 0; | |
38 } | |
39 | |
40 } // namespace commands | |
OLD | NEW |