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

Unified Diff: tools/gn/substitution_writer.cc

Issue 1868023002: Add GN output prefix override and allow empty output extensions. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/ninja_binary_target_writer_unittest.cc ('k') | tools/gn/substitution_writer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/substitution_writer.cc
diff --git a/tools/gn/substitution_writer.cc b/tools/gn/substitution_writer.cc
index 99abced1e3cde83c44cb2b2bc26a66516f689a2e..23d6914ac4e9e52b417730dddfc3895ae47b5203 100644
--- a/tools/gn/substitution_writer.cc
+++ b/tools/gn/substitution_writer.cc
@@ -448,7 +448,7 @@ bool SubstitutionWriter::GetTargetSubstitution(
result);
break;
case SUBSTITUTION_TARGET_OUTPUT_NAME:
- *result = target->GetComputedOutputName(true);
+ *result = target->GetComputedOutputName();
break;
default:
return false;
@@ -547,11 +547,13 @@ std::string SubstitutionWriter::GetLinkerSubstitution(
// Fall-through to the linker-specific ones.
switch (type) {
case SUBSTITUTION_OUTPUT_EXTENSION:
- // Use the extension provided on the target if nonempty, otherwise
+ // Use the extension provided on the target if specified, otherwise
// fall back on the default. Note that the target's output extension
// does not include the dot but the tool's does.
- if (target->output_extension().empty())
+ if (!target->output_extension_set())
return tool->default_output_extension();
+ if (target->output_extension().empty())
+ return std::string(); // Explicitly set to no extension.
return std::string(".") + target->output_extension();
default:
« no previous file with comments | « tools/gn/ninja_binary_target_writer_unittest.cc ('k') | tools/gn/substitution_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698