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.
5 #include "tools/gn/commands.h"
6 #include "tools/gn/setup.h"
7 #include "tools/gn/standard_out.h"
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"
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"
21 " See \"gn help\" for the common command-line switches.\n";
23 int RunCheck(const std::vector
<std::string
>& args
) {
24 // Deliberately leaked to avoid expensive process teardown.
25 Setup
* setup
= new Setup();
26 // TODO(brettw) bug 343726: Use a temporary directory instead of this
27 // default one to avoid messing up any build that's in there.
28 if (!setup
->DoSetup("//out/Default"))
30 setup
->set_check_public_headers(true);
35 OutputString("Header dependency check OK\n", DECORATION_GREEN
);
39 } // namespace commands