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(); |
} |