aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/dump.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-04-06 14:39:34 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-04-06 14:39:34 +0200
commitd1f436049f0fba43ed1d5e5d8e490b7873009403 (patch)
treeac683030a61c777673be720b33482a731817295f /libbuild2/dump.cxx
parent76be0a35f6c37cda7ba65530330f1ac246fb52a8 (diff)
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}
Diffstat (limited to 'libbuild2/dump.cxx')
-rw-r--r--libbuild2/dump.cxx8
1 files changed, 8 insertions, 0 deletions
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.