From d1f436049f0fba43ed1d5e5d8e490b7873009403 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 6 Apr 2022 14:39:34 +0200 Subject: Add support for specifying custom ad hoc pattern rule names Besides diagnostics, this allows us to use name in the rule hint, for example: [rule_name=hello.link] exe{~'/(.*)/'}: obje{~'/\1/'} {{ $cxx.path -o $path($>) $path($<[0]) }} [rule_hint=hello] exe{hello}: obje{hello} obje{hello}: c{hello-c} --- libbuild2/dump.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libbuild2/dump.cxx') diff --git a/libbuild2/dump.cxx b/libbuild2/dump.cxx index befd86b..14078da 100644 --- a/libbuild2/dump.cxx +++ b/libbuild2/dump.cxx @@ -225,6 +225,14 @@ namespace build2 // Pattern. // os << ind; + + // Avoid printing the derived name. + // + if (rp.rule_name.front () != '<' || rp.rule_name.back () != '>') + { + os << "[rule_name=" << rp.rule_name << "] "; + } + rp.dump (os); // Recipes. -- cgit v1.1