From e4f41c7319261b9585bd501256664679457e1d9d 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/target.hxx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'build2/target.hxx') diff --git a/build2/target.hxx b/build2/target.hxx index db5de67..127940a 100644 --- a/build2/target.hxx +++ b/build2/target.hxx @@ -648,6 +648,18 @@ namespace build2 static const target_type static_type; public: + // Split the name leaf into target name (in place) and extension + // (returned). + // + static optional + split_name (string&, const location&); + + // Combine the target name and extension into the name leaf. + // + static void + combine_name (string&, const optional&); + + public: virtual ~target (); @@ -1704,7 +1716,9 @@ namespace build2 template bool - target_pattern_fix (const target_type&, const scope&, string&, bool); + target_pattern_fix (const target_type&, const scope&, + string&, optional&, + bool); // Get the extension from the variable or use the default if none set. If // the default is NULL, then return NULL. @@ -1715,7 +1729,9 @@ namespace build2 template bool - target_pattern_var (const target_type&, const scope&, string&, bool); + target_pattern_var (const target_type&, const scope&, + string&, optional&, + bool); // Always return NULL extension. // -- cgit v1.1