| 259 | } |
| 260 | |
| 261 | bool HandleHashCommand(std::vector<std::string> const& args, |
| 262 | cmExecutionStatus& status) |
| 263 | { |
| 264 | #if !defined(CMAKE_BOOTSTRAP) |
| 265 | if (args.size() != 3) { |
| 266 | status.SetError( |
| 267 | cmStrCat(args[0], " requires a file name and output variable")); |
| 268 | return false; |
| 269 | } |
| 270 | |
| 271 | std::unique_ptr<cmCryptoHash> hash(cmCryptoHash::New(args[0])); |
| 272 | if (hash) { |
| 273 | std::string out = hash->HashFile(args[1]); |
| 274 | if (!out.empty()) { |
| 275 | status.GetMakefile().AddDefinition(args[2], out); |
| 276 | return true; |
| 277 | } |
| 278 | status.SetError(cmStrCat(args[0], " failed to read file \"", args[1], |
| 279 | "\": ", cmSystemTools::GetLastSystemError())); |
| 280 | } |
| 281 | return false; |
| 282 | #else |
| 283 | status.SetError(cmStrCat(args[0], " not available during bootstrap")); |
| 284 | return false; |
| 285 | #endif |
| 286 | } |
| 287 | |
| 288 | bool HandleStringsCommand(std::vector<std::string> const& args, |
| 289 | cmExecutionStatus& status) |
nothing calls this directly
no test coverage detected
searching dependent graphs…