OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "tools/gn/commands.h" | 7 #include "tools/gn/commands.h" |
8 #include "tools/gn/header_checker.h" | 8 #include "tools/gn/header_checker.h" |
9 #include "tools/gn/setup.h" | 9 #include "tools/gn/setup.h" |
10 #include "tools/gn/standard_out.h" | 10 #include "tools/gn/standard_out.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 if (setup->check_patterns()) { | 85 if (setup->check_patterns()) { |
86 FilterTargetsByPatterns(all_targets, *setup->check_patterns(), | 86 FilterTargetsByPatterns(all_targets, *setup->check_patterns(), |
87 &targets_to_check); | 87 &targets_to_check); |
88 filtered_by_build_config = targets_to_check.size() != all_targets.size(); | 88 filtered_by_build_config = targets_to_check.size() != all_targets.size(); |
89 } else { | 89 } else { |
90 // No global filter, check everything. | 90 // No global filter, check everything. |
91 targets_to_check = all_targets; | 91 targets_to_check = all_targets; |
92 } | 92 } |
93 } | 93 } |
94 | 94 |
95 const CommandLine* cmdline = CommandLine::ForCurrentProcess(); | 95 const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); |
96 bool force = cmdline->HasSwitch("force"); | 96 bool force = cmdline->HasSwitch("force"); |
97 | 97 |
98 if (!CheckPublicHeaders(&setup->build_settings(), all_targets, | 98 if (!CheckPublicHeaders(&setup->build_settings(), all_targets, |
99 targets_to_check, force)) | 99 targets_to_check, force)) |
100 return 1; | 100 return 1; |
101 | 101 |
102 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kQuiet)) { | 102 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kQuiet)) { |
103 if (filtered_by_build_config) { | 103 if (filtered_by_build_config) { |
104 // Tell the user about the implicit filtering since this is obscure. | 104 // Tell the user about the implicit filtering since this is obscure. |
105 OutputString(base::StringPrintf( | 105 OutputString(base::StringPrintf( |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 for (const auto& pattern : filter) { | 139 for (const auto& pattern : filter) { |
140 if (pattern.Matches(target->label())) { | 140 if (pattern.Matches(target->label())) { |
141 output->push_back(target); | 141 output->push_back(target); |
142 break; | 142 break; |
143 } | 143 } |
144 } | 144 } |
145 } | 145 } |
146 } | 146 } |
147 | 147 |
148 } // namespace commands | 148 } // namespace commands |
OLD | NEW |