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

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

Issue 2492273002: GN: Always check for bad items. (Closed)
Patch Set: Created 4 years, 1 month 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
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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 void Setup::RunPreMessageLoop() { 323 void Setup::RunPreMessageLoop() {
324 // Load the root build file. 324 // Load the root build file.
325 loader_->Load(root_build_file_, LocationRange(), Label()); 325 loader_->Load(root_build_file_, LocationRange(), Label());
326 326
327 // Will be decremented with the loader is drained. 327 // Will be decremented with the loader is drained.
328 g_scheduler->IncrementWorkCount(); 328 g_scheduler->IncrementWorkCount();
329 } 329 }
330 330
331 bool Setup::RunPostMessageLoop() { 331 bool Setup::RunPostMessageLoop() {
332 Err err; 332 Err err;
333 if (build_settings_.check_for_bad_items()) { 333 if (!builder_.CheckForBadItems(&err)) {
334 if (!builder_.CheckForBadItems(&err)) { 334 err.PrintToStdout();
335 err.PrintToStdout(); 335 return false;
336 }
337
338 if (!build_settings_.build_args().VerifyAllOverridesUsed(&err)) {
339 // TODO(brettw) implement a system to have a different marker for
340 // warnings. Until we have a better system, print the error but don't
341 // return failure unless requested on the command line.
342 err.PrintToStdout();
343 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
344 switches::kFailOnUnusedArgs))
336 return false; 345 return false;
337 } 346 return true;
338
339 if (!build_settings_.build_args().VerifyAllOverridesUsed(&err)) {
340 // TODO(brettw) implement a system to have a different marker for
341 // warnings. Until we have a better system, print the error but don't
342 // return failure unless requested on the command line.
343 err.PrintToStdout();
344 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
345 switches::kFailOnUnusedArgs))
346 return false;
347 return true;
348 }
349 } 347 }
350 348
351 if (check_public_headers_) { 349 if (check_public_headers_) {
352 std::vector<const Target*> all_targets = builder_.GetAllResolvedTargets(); 350 std::vector<const Target*> all_targets = builder_.GetAllResolvedTargets();
353 std::vector<const Target*> to_check; 351 std::vector<const Target*> to_check;
354 if (check_patterns()) { 352 if (check_patterns()) {
355 commands::FilterTargetsByPatterns(all_targets, *check_patterns(), 353 commands::FilterTargetsByPatterns(all_targets, *check_patterns(),
356 &to_check); 354 &to_check);
357 } else { 355 } else {
358 to_check = all_targets; 356 to_check = all_targets;
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 if (err.has_error()) { 733 if (err.has_error()) {
736 err.PrintToStdout(); 734 err.PrintToStdout();
737 return false; 735 return false;
738 } 736 }
739 } 737 }
740 build_settings_.set_exec_script_whitelist(std::move(whitelist)); 738 build_settings_.set_exec_script_whitelist(std::move(whitelist));
741 } 739 }
742 740
743 return true; 741 return true;
744 } 742 }
OLDNEW
« tools/gn/command_args.cc ('K') | « tools/gn/command_refs.cc ('k') | tools/gn/target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698