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

Unified Diff: tools/gn/target.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
Index: tools/gn/target.cc
diff --git a/tools/gn/target.cc b/tools/gn/target.cc
index 005dd973b2961cb4f445a1a61bb302a85df03b71..7d6e530b76dc1d2c77a25f296b3c095b2ef2dfd9 100644
--- a/tools/gn/target.cc
+++ b/tools/gn/target.cc
@@ -212,6 +212,8 @@ bool RecursiveCheckAssertNoDeps(const Target* target,
Target::Target(const Settings* settings, const Label& label)
: Item(settings, label),
output_type_(UNKNOWN),
+ output_prefix_override_(false),
+ output_extension_set_(false),
all_headers_public_(true),
check_includes_(true),
complete_static_lib_(false),
@@ -369,8 +371,10 @@ std::string Target::GetComputedOutputName(bool include_prefix) const {
if (include_prefix) {
const Tool* tool = toolchain_->GetToolForTargetFinalOutput(this);
if (tool) {
- // Only add the prefix if the name doesn't already have it.
- if (!base::StartsWith(name, tool->output_prefix(),
+ // Only add the prefix if the name doesn't already have it and it's not
+ // being overridden.
+ if (!output_prefix_override_ &&
+ !base::StartsWith(name, tool->output_prefix(),
base::CompareCase::SENSITIVE))
result = tool->output_prefix();
}
« no previous file with comments | « tools/gn/target.h ('k') | tools/gn/target_unittest.cc » ('j') | tools/gn/target_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698