From 593fd960891027b97567b2622ed4b6c16070ab36 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 28 Apr 2017 08:33:42 +0200 Subject: Implement support for pre-processing version headers (or other files) Also implement the build system version check. --- build2/cli/rule.cxx | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'build2/cli') diff --git a/build2/cli/rule.cxx b/build2/cli/rule.cxx index 884635a..2eb98c7 100644 --- a/build2/cli/rule.cxx +++ b/build2/cli/rule.cxx @@ -218,24 +218,24 @@ namespace build2 // as potentially affecting the result (think prologues/epilogues, // etc). // - const cli* s; - { - // The rule has been matched which means the members should be - // resolved and paths assigned. - // - auto p ( - execute_prerequisites ( - a, t, t.load_mtime (t.h->path ()))); - if ((s = p.first) == nullptr) - return p.second; - } + // The rule has been matched which means the members should be resolved + // and paths assigned. + // + auto pr ( + execute_prerequisites ( + a, t, t.load_mtime (t.h->path ()))); + + if (pr.first) + return *pr.first; + + const cli& s (pr.second); // Translate paths to relative (to working directory). This // results in easier to read diagnostics. // path relo (relative (t.dir)); - path rels (relative (s->path ())); + path rels (relative (s.path ())); const scope& rs (t.root_scope ()); @@ -246,7 +246,7 @@ namespace build2 // See if we need to pass --output-{prefix,suffix} // string prefix, suffix; - match_stem (t.name, s->name, &prefix, &suffix); + match_stem (t.name, s.name, &prefix, &suffix); if (!prefix.empty ()) { @@ -281,7 +281,7 @@ namespace build2 if (verb >= 2) print_process (args); else if (verb) - text << "cli " << *s; + text << "cli " << s; try { -- cgit v1.1