From e4a3a97bc76e6e88dede7e39afe126eb021a78d7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Jun 2018 12:26:16 +0200 Subject: If target type doesn't use extensions, factor it back into name --- build2/scope.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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; } -- cgit v1.1