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

Side by Side Diff: tools/gn/setup.cc

Issue 1907613002: GN flag to fail for unused build args. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « tools/gn/docs/reference.md ('k') | tools/gn/switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "tools/gn/setup.h" 5 #include "tools/gn/setup.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <sstream> 9 #include <sstream>
10 #include <utility> 10 #include <utility>
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 325
326 bool Setup::RunPostMessageLoop() { 326 bool Setup::RunPostMessageLoop() {
327 Err err; 327 Err err;
328 if (build_settings_.check_for_bad_items()) { 328 if (build_settings_.check_for_bad_items()) {
329 if (!builder_->CheckForBadItems(&err)) { 329 if (!builder_->CheckForBadItems(&err)) {
330 err.PrintToStdout(); 330 err.PrintToStdout();
331 return false; 331 return false;
332 } 332 }
333 333
334 if (!build_settings_.build_args().VerifyAllOverridesUsed(&err)) { 334 if (!build_settings_.build_args().VerifyAllOverridesUsed(&err)) {
335 // TODO(brettw) implement a system of warnings. Until we have a better 335 // TODO(brettw) implement a system to have a different marker for
336 // system, print the error but don't return failure. 336 // warnings. Until we have a better system, print the error but don't
337 // return failure unless requested on the command line.
337 err.PrintToStdout(); 338 err.PrintToStdout();
339 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
340 switches::kFailOnUnusedArgs))
341 return false;
338 return true; 342 return true;
Dirk Pranke 2016/04/23 01:27:17 I actually feel (reasonably strongly) that we shou
339 } 343 }
340 } 344 }
341 345
342 if (check_public_headers_) { 346 if (check_public_headers_) {
343 std::vector<const Target*> all_targets = builder_->GetAllResolvedTargets(); 347 std::vector<const Target*> all_targets = builder_->GetAllResolvedTargets();
344 std::vector<const Target*> to_check; 348 std::vector<const Target*> to_check;
345 if (check_patterns()) { 349 if (check_patterns()) {
346 commands::FilterTargetsByPatterns(all_targets, *check_patterns(), 350 commands::FilterTargetsByPatterns(all_targets, *check_patterns(),
347 &to_check); 351 &to_check);
348 } else { 352 } else {
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 if (err.has_error()) { 726 if (err.has_error()) {
723 err.PrintToStdout(); 727 err.PrintToStdout();
724 return false; 728 return false;
725 } 729 }
726 } 730 }
727 build_settings_.set_exec_script_whitelist(std::move(whitelist)); 731 build_settings_.set_exec_script_whitelist(std::move(whitelist));
728 } 732 }
729 733
730 return true; 734 return true;
731 } 735 }
OLDNEW
« no previous file with comments | « tools/gn/docs/reference.md ('k') | tools/gn/switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698