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

Unified Diff: tools/gn/command_check.cc

Issue 516683002: Add GN variables for controlling header checking. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@desc
Patch Set: merge Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/binary_target_generator.cc ('k') | tools/gn/commands.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/command_check.cc
diff --git a/tools/gn/command_check.cc b/tools/gn/command_check.cc
index 74ffb42e098a24f4062fc142bfb725d99dc22da9..b3c8412d7e7b743e4cc352fe7c4910740e12a912 100644
--- a/tools/gn/command_check.cc
+++ b/tools/gn/command_check.cc
@@ -14,7 +14,7 @@ const char kCheck[] = "check";
const char kCheck_HelpShort[] =
"check: Check header dependencies.";
const char kCheck_Help[] =
- "gn check <out_dir> [<target label>]\n"
+ "gn check <out_dir> [<target label>] [--force]\n"
"\n"
" \"gn check\" is the same thing as \"gn gen\" with the \"--check\" flag\n"
" except that this command does not write out any build files. It's\n"
@@ -25,6 +25,10 @@ const char kCheck_Help[] =
" only those matching targets will be checked.\n"
" See \"gn help label_pattern\" for details.\n"
"\n"
+ " --force\n"
+ " Ignores specifications of \"check_includes = false\" and checks\n"
+ " all target's files that match the target label.\n"
+ "\n"
" See \"gn help\" for the common command-line switches.\n"
"\n"
"Examples\n"
@@ -64,9 +68,13 @@ int RunCheck(const std::vector<std::string>& args) {
}
}
+ const CommandLine* cmdline = CommandLine::ForCurrentProcess();
+ bool force = cmdline->HasSwitch("force");
+
if (!CheckPublicHeaders(&setup->build_settings(),
setup->builder()->GetAllResolvedTargets(),
- targets_to_check))
+ targets_to_check,
+ force))
return 1;
OutputString("Header dependency check OK\n", DECORATION_GREEN);
@@ -75,14 +83,15 @@ int RunCheck(const std::vector<std::string>& args) {
bool CheckPublicHeaders(const BuildSettings* build_settings,
const std::vector<const Target*>& all_targets,
- const std::vector<const Target*>& to_check) {
+ const std::vector<const Target*>& to_check,
+ bool force_check) {
ScopedTrace trace(TraceItem::TRACE_CHECK_HEADERS, "Check headers");
scoped_refptr<HeaderChecker> header_checker(
new HeaderChecker(build_settings, all_targets));
std::vector<Err> header_errors;
- header_checker->Run(to_check, &header_errors);
+ header_checker->Run(to_check, force_check, &header_errors);
for (size_t i = 0; i < header_errors.size(); i++) {
if (i > 0)
OutputString("___________________\n", DECORATION_YELLOW);
« no previous file with comments | « tools/gn/binary_target_generator.cc ('k') | tools/gn/commands.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698