diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-06-29 10:39:26 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-06-29 10:39:26 +0200 |
commit | 50e1ffc8f9c48e3e81bd5fa38381193942182df3 (patch) | |
tree | befd6198abbbfbee98c2d87f48bb06b667941415 /build2/cli/init.cxx | |
parent | 67b17701d5b1753dc6aaf5a63a4dc2ef2642ba83 (diff) |
Use depdb to track changes to cli compiler, options, etc
Diffstat (limited to 'build2/cli/init.cxx')
-rw-r--r-- | build2/cli/init.cxx | 33 |
1 files changed, 27 insertions, 6 deletions
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<path> ("config.cli", true); v.insert<strings> ("config.cli.options", true); + //@@ TODO: split version into componets (it is stdver). + // v.insert<process_path> ("cli.path"); + v.insert<string> ("cli.version"); + v.insert<string> ("cli.checksum"); v.insert<strings> ("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<process_path> ("cli.path") = move (pp); + { + rs.assign ("cli.path") = move (pp); + rs.assign ("cli.version") = move (ver); + rs.assign ("cli.checksum") = move (checksum); + } } if (conf) |