ozone: dri: Fix crash during DriConsoleBuffer destruction
[chromium-blink-merge.git] / tools / gn / command_check.cc
blob3546b7c1aa945580d307bd15a57c0986f9be006b
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"
9 namespace commands {
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";
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"))
29 return 1;
30 setup->set_check_public_headers(true);
32 if (!setup->Run())
33 return 1;
35 OutputString("Header dependency check OK\n", DECORATION_GREEN);
36 return 0;
39 } // namespace commands