From c2b4305349ca855c497904282db354de56c74842 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 7 Aug 2018 14:59:07 +0200 Subject: Add support for default extension specification, trailing dot escaping For example: cxx{*}: extension = cxx cxx{foo} # foo.cxx cxx{foo.test} # foo.test (probably what we want...) cxx{foo.test...} # foo.test.cxx (... is this) cxx{foo..} # foo. cxx{foo....} # foo.. cxx{foo.....} # error (must come in escape pair) --- build2/cc/common.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'build2/cc') diff --git a/build2/cc/common.cxx b/build2/cc/common.cxx index ca73483..c6ef3bd 100644 --- a/build2/cc/common.cxx +++ b/build2/cc/common.cxx @@ -431,11 +431,9 @@ namespace build2 { // This is import. // - optional ext; - - // Changes name. - // - const target_type* tt (s.find_target_type (n, ext, location ())); + auto rp (s.find_target_type (n, location ())); // Note: changes name. + const target_type* tt (rp.first); + optional& ext (rp.second); if (tt == nullptr) fail << "unknown target type '" << n.type << "' in library " << n; -- cgit v1.1