diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-28 08:33:42 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-28 08:33:42 +0200 |
commit | 593fd960891027b97567b2622ed4b6c16070ab36 (patch) | |
tree | f4cb383f8606fde6adff7ac9f90a20cc9ad59840 /build2/cli | |
parent | ac402e1fef2c13b5860ca5223d764bbfdfb867e3 (diff) |
Implement support for pre-processing version headers (or other files)
Also implement the build system version check.
Diffstat (limited to 'build2/cli')
-rw-r--r-- | build2/cli/rule.cxx | 28 |
1 files changed, 14 insertions, 14 deletions
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<cli> ( - 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<cli> ( + 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 { |