From 50e1ffc8f9c48e3e81bd5fa38381193942182df3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 29 Jun 2018 10:39:26 +0200 Subject: Use depdb to track changes to cli compiler, options, etc --- build2/cli/init.cxx | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'build2/cli/init.cxx') diff --git a/build2/cli/init.cxx b/build2/cli/init.cxx index 88a8d69..8e0abdb 100644 --- a/build2/cli/init.cxx +++ b/build2/cli/init.cxx @@ -53,7 +53,11 @@ namespace build2 v.insert ("config.cli", true); v.insert ("config.cli.options", true); + //@@ TODO: split version into componets (it is stdver). + // v.insert ("cli.path"); + v.insert ("cli.version"); + v.insert ("cli.checksum"); v.insert ("cli.options"); } @@ -214,11 +218,23 @@ namespace build2 nv = p.second; } - // Note that we are unconfigured so that we don't keep re-testing this - // on each run. - // - if (!conf) + string checksum; + if (conf) + { + // Hash the compiler path and version. + // + sha256 cs; + cs.append (pp.effect_string ()); + cs.append (ver); + checksum = cs.string (); + } + else + { + // Note that we are unconfigured so that we don't keep re-testing + // this on each run. + // nv = config::unconfigured (rs, "cli", true) || nv; + } // If this is a new value (e.g., we are configuring), then print the // report at verbosity level 2 and up (-v). @@ -230,13 +246,18 @@ namespace build2 if (conf) dr << " cli " << pp << '\n' - << " version " << ver; + << " version " << ver << '\n' + << " checksum " << checksum; else dr << " cli " << "not found, leaving unconfigured"; } if (conf) - rs.assign ("cli.path") = move (pp); + { + rs.assign ("cli.path") = move (pp); + rs.assign ("cli.version") = move (ver); + rs.assign ("cli.checksum") = move (checksum); + } } if (conf) -- cgit v1.1