| 3710 | } |
| 3711 | |
| 3712 | void cmGlobalGenerator::AddRuleHash(std::vector<std::string> const& outputs, |
| 3713 | std::string const& content) |
| 3714 | { |
| 3715 | // Ignore if there are no outputs. |
| 3716 | if (outputs.empty()) { |
| 3717 | return; |
| 3718 | } |
| 3719 | |
| 3720 | // Compute a hash of the rule. |
| 3721 | RuleHash hash; |
| 3722 | { |
| 3723 | cmCryptoHash md5(cmCryptoHash::AlgoMD5); |
| 3724 | std::string const md5_hex = md5.HashString(content); |
| 3725 | memcpy(hash.Data, md5_hex.c_str(), 32); |
| 3726 | } |
| 3727 | |
| 3728 | // Shorten the output name (in expected use case). |
| 3729 | std::string fname = |
| 3730 | this->LocalGenerators[0]->MaybeRelativeToTopBinDir(outputs[0]); |
| 3731 | |
| 3732 | // Associate the hash with this output. |
| 3733 | this->RuleHashes[fname] = hash; |
| 3734 | } |
| 3735 | |
| 3736 | void cmGlobalGenerator::CheckRuleHashes() |
| 3737 | { |
no test coverage detected