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

Unified Diff: tools/gn/command_refs.cc

Issue 1126193005: Check for inputs not generated by deps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@data
Patch Set: Created 5 years, 6 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/command_ls.cc ('k') | tools/gn/filesystem_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/command_refs.cc
diff --git a/tools/gn/command_refs.cc b/tools/gn/command_refs.cc
index 9c89114668d96bdf33acbaeca65c41f266ae0136..a97e9a759b9a697aa64610329bc1e2ef709af89d 100644
--- a/tools/gn/command_refs.cc
+++ b/tools/gn/command_refs.cc
@@ -141,6 +141,13 @@ bool TargetContainsFile(const Target* target, const SourceFile& file) {
if (cur_file == file.value())
return true;
}
+
+ std::vector<SourceFile> outputs;
+ target->action_values().GetOutputsAsSourceFiles(target, &outputs);
+ for (const auto& cur_file : outputs) {
+ if (cur_file == file)
+ return true;
+ }
return false;
}
@@ -286,9 +293,9 @@ const char kRefs_Help[] =
" \"gn help label_pattern\" for details.\n"
"\n"
" - File name: The result will be which targets list the given file in\n"
- " its \"inputs\", \"sources\", \"public\", or \"data\". Any input\n"
- " that does not contain wildcards and does not match a target or a\n"
- " config will be treated as a file.\n"
+ " its \"inputs\", \"sources\", \"public\", \"data\", or \"outputs\".\n"
+ " Any input that does not contain wildcards and does not match a\n"
+ " target or a config will be treated as a file.\n"
"\n"
" - Response file: If the input starts with an \"@\", it will be\n"
" interpreted as a path to a file containing a list of labels or\n"
@@ -391,7 +398,7 @@ int RunRefs(const std::vector<std::string>& args) {
bool all_toolchains = cmdline->HasSwitch("all-toolchains");
Setup* setup = new Setup;
- setup->set_check_for_bad_items(false);
+ setup->build_settings().set_check_for_bad_items(false);
if (!setup->DoSetup(args[0], false) || !setup->Run())
return 1;
« no previous file with comments | « tools/gn/command_ls.cc ('k') | tools/gn/filesystem_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698