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

Side by Side Diff: tools/gn/command_refs.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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 .PrintToStdout(); 396 .PrintToStdout();
397 return 1; 397 return 1;
398 } 398 }
399 399
400 const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); 400 const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
401 bool tree = cmdline->HasSwitch("tree"); 401 bool tree = cmdline->HasSwitch("tree");
402 bool all = cmdline->HasSwitch("all"); 402 bool all = cmdline->HasSwitch("all");
403 bool all_toolchains = cmdline->HasSwitch(switches::kAllToolchains); 403 bool all_toolchains = cmdline->HasSwitch(switches::kAllToolchains);
404 404
405 Setup* setup = new Setup; 405 Setup* setup = new Setup;
406 setup->build_settings().set_check_for_bad_items(false);
407 if (!setup->DoSetup(args[0], false) || !setup->Run()) 406 if (!setup->DoSetup(args[0], false) || !setup->Run())
408 return 1; 407 return 1;
409 408
410 // The inputs are everything but the first arg (which is the build dir). 409 // The inputs are everything but the first arg (which is the build dir).
411 std::vector<std::string> inputs; 410 std::vector<std::string> inputs;
412 for (size_t i = 1; i < args.size(); i++) { 411 for (size_t i = 1; i < args.size(); i++) {
413 if (args[i][0] == '@') { 412 if (args[i][0] == '@') {
414 // The argument is as a path to a response file. 413 // The argument is as a path to a response file.
415 std::string contents; 414 std::string contents;
416 bool ret = base::ReadFileToString(UTF8ToFilePath(args[i].substr(1)), 415 bool ret = base::ReadFileToString(UTF8ToFilePath(args[i].substr(1)),
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 484
486 // If you ask for the references of a valid target, but that target has 485 // If you ask for the references of a valid target, but that target has
487 // nothing referencing it, we'll get here without having printed anything. 486 // nothing referencing it, we'll get here without having printed anything.
488 if (!quiet && cnt == 0) 487 if (!quiet && cnt == 0)
489 OutputString("Nothing references this.\n", DECORATION_YELLOW); 488 OutputString("Nothing references this.\n", DECORATION_YELLOW);
490 489
491 return 0; 490 return 0;
492 } 491 }
493 492
494 } // namespace commands 493 } // namespace commands
OLDNEW
« tools/gn/command_args.cc ('K') | « tools/gn/command_ls.cc ('k') | tools/gn/setup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698