aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/scope.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/build2/scope.cxx b/build2/scope.cxx
index d4ec9c8..ff004b5 100644
--- a/build2/scope.cxx
+++ b/build2/scope.cxx
@@ -674,6 +674,19 @@ namespace build2
r = &file::static_type;
}
+ // If the target type does not use extensions but one was specified,
+ // factor it back into the name (this way we won't assert when printing
+ // diagnostics; see to_stream(target_key) for details).
+ //
+ if (ext &&
+ r->fixed_extension == nullptr &&
+ r->default_extension == nullptr)
+ {
+ v += '.';
+ v += *ext;
+ ext = nullopt;
+ }
+
return r;
}