From 6b3e75edf034ebcbd048a24c283c7bcf7b1da019 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 25 May 2021 11:19:04 +0200 Subject: Add support for regex-based target type/pattern specific variables This is in addition to the already supported path-based target type/pattern specific variables. For example: hxx{*}: x = y # path-based hxx{~/.*/}: x = y # regex-based --- libbuild2/scope.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libbuild2/scope.cxx') diff --git a/libbuild2/scope.cxx b/libbuild2/scope.cxx index 46e3dcd..f2700c4 100644 --- a/libbuild2/scope.cxx +++ b/libbuild2/scope.cxx @@ -49,7 +49,7 @@ namespace build2 const scope* s, const target_key* tk, const target_key* gk, - optional n) + string n) { const value& v (*l); assert ((v.extra == 1 || v.extra == 2) && v.type == nullptr); @@ -70,7 +70,7 @@ namespace build2 pair entry ( s->target_vars.cache.insert ( ctx, - make_tuple (&v, tk->type, n && !n->empty () ? move (*n) : *tk->name), + make_tuple (&v, tk->type, !n.empty () ? move (n) : *tk->name), stem, static_cast (v).version, var)); @@ -146,7 +146,7 @@ namespace build2 if (l.defined ()) { if (l->extra != 0) // Prepend/append? - pre_app (l, s, tk, gk, move (tn)); + pre_app (l, s, tk, gk, move (*tn)); return make_pair (move (l), d); } @@ -164,7 +164,7 @@ namespace build2 if (l.defined ()) { if (l->extra != 0) // Prepend/append? - pre_app (l, s, gk, nullptr, move (gn)); + pre_app (l, s, gk, nullptr, move (*gn)); return make_pair (move (l), d); } -- cgit v1.1