diff options
Diffstat (limited to 'libbuild2/version/rule.cxx')
-rw-r--r-- | libbuild2/version/rule.cxx | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/libbuild2/version/rule.cxx b/libbuild2/version/rule.cxx index 1799666..65c1117 100644 --- a/libbuild2/version/rule.cxx +++ b/libbuild2/version/rule.cxx @@ -93,6 +93,12 @@ namespace build2 if (!fi) l5 ([&]{trace << "no in file prerequisite for target " << t;}); + // If we match, derive the file name early as recommended by the in + // rule. + // + if (fm && fi) + t.derive_path (); + return fm && fi; } @@ -115,6 +121,7 @@ namespace build2 const target& t, const string& n, optional<uint64_t> flags, + const substitution_map* smap, const optional<string>& null) const { assert (!flags); @@ -138,8 +145,7 @@ namespace build2 a, t, p == string::npos ? n : string (n, p + 1), - nullopt, - null); + nullopt, smap, null); } string pn (n, 0, p); @@ -241,13 +247,13 @@ namespace build2 if (mav->snapshot ()) { - r += (p ? "(" : ""); + if (p) r += '('; r += cmp (vm, " < ", mav->version) + " || ("; r += cmp (vm, " == ", mav->version) + " && "; - r += cmp (sm, (mao ? " < " : " <= "), mav->snapshot_sn) + ")"; + r += cmp (sm, (mao ? " < " : " <= "), mav->snapshot_sn) + ')'; - r += (p ? ")" : ""); + if (p) r += ')'; } else r = cmp (vm, (mao ? " < " : " <= "), mav->version); @@ -261,13 +267,13 @@ namespace build2 if (miv->snapshot ()) { - r += (p ? "(" : ""); + if (p) r += '('; r += cmp (vm, " > ", miv->version) + " || ("; r += cmp (vm, " == ", miv->version) + " && "; - r += cmp (sm, (mio ? " > " : " >= "), miv->snapshot_sn) + ")"; + r += cmp (sm, (mio ? " > " : " >= "), miv->snapshot_sn) + ')'; - r += (p ? ")" : ""); + if (p) r += ')'; } else r = cmp (vm, (mio ? " > " : " >= "), miv->version); |