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

Unified Diff: tools/gn/command_desc.cc

Issue 2105333002: Display outputs for "executable" targets in "gn desc". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@{1}
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/command_desc.cc
diff --git a/tools/gn/command_desc.cc b/tools/gn/command_desc.cc
index d1edfe487b42baadd4e1cdfac511125b1a582a93..00224f2cf3a97523fb8a8d9bc557efa556e43dec 100644
--- a/tools/gn/command_desc.cc
+++ b/tools/gn/command_desc.cc
@@ -338,6 +338,20 @@ void PrintOutputs(const Target* target, bool display_header) {
target->bundle_data().GetOutputsAsSourceFiles(target->settings(),
&output_files);
PrintFileList(output_files, std::string(), true, false);
+ } else if (target->output_type() == Target::EXECUTABLE) {
+ const Tool* tool = target->toolchain()->GetToolForTargetFinalOutput(target);
+
+ std::vector<OutputFile> output_files;
+ SubstitutionWriter::ApplyListToLinkerAsOutputFile(
+ target, tool, tool->outputs(), &output_files);
+
+ std::vector<SourceFile> output_files_as_source_file;
+ for (const OutputFile& output_file : output_files) {
+ output_files_as_source_file.push_back(
+ output_file.AsSourceFile(target->settings()->build_settings()));
+ }
+
+ PrintFileList(output_files_as_source_file, std::string(), true, false);
} else {
brettw 2016/06/29 23:12:09 Currently the "outputs" section was actually the o
sdefresne 2016/07/01 13:12:40 Done.
const SubstitutionList& outputs = target->action_values().outputs();
if (!outputs.required_types().empty()) {
@@ -616,7 +630,8 @@ bool PrintTarget(const Target* target,
if (target->output_type() == Target::ACTION ||
target->output_type() == Target::ACTION_FOREACH ||
target->output_type() == Target::COPY_FILES ||
- target->output_type() == Target::CREATE_BUNDLE) {
+ target->output_type() == Target::CREATE_BUNDLE ||
+ target->output_type() == Target::EXECUTABLE) {
if (what.empty() || what == variables::kOutputs) {
PrintOutputs(target, display_headers);
found_match = true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698