diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-05-25 11:19:04 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-05-28 10:10:44 +0200 |
commit | 6b3e75edf034ebcbd048a24c283c7bcf7b1da019 (patch) | |
tree | 4dff34692fd09c6f201a486c0d92549adc864947 /libbuild2/scope.cxx | |
parent | bb02e152dc036879ab0b2d1d8aa2cb19084b8e16 (diff) |
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
Diffstat (limited to 'libbuild2/scope.cxx')
-rw-r--r-- | libbuild2/scope.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
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<string> n) + string n) { const value& v (*l); assert ((v.extra == 1 || v.extra == 2) && v.type == nullptr); @@ -70,7 +70,7 @@ namespace build2 pair<value&, ulock> 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<const variable_map::value_data&> (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); } |