1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-15 12:16:40 +08:00

cmGlobalGenerator: Simplify relative path conversion in AddRuleHash

Revert commit 204aecdf82 (cmGlobalGenerator: Port configure-time code to
cmMakefile., 2015-08-02, v3.4.0-rc1~234^2~8).  `AddRuleHash` is
generate-time code.
This commit is contained in:
Brad King
2021-05-13 09:19:44 -04:00
parent d346805e41
commit f0ffb1e2d4

View File

@@ -3027,10 +3027,8 @@ void cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs,
}
// Shorten the output name (in expected use case).
cmStateDirectory cmDir =
this->GetMakefiles()[0]->GetStateSnapshot().GetDirectory();
std::string fname = cmDir.ConvertToRelPathIfContained(
this->GetMakefiles()[0]->GetState()->GetBinaryDirectory(), outputs[0]);
std::string fname =
this->LocalGenerators[0]->MaybeRelativeToTopBinDir(outputs[0]);
// Associate the hash with this output.
this->RuleHashes[fname] = hash;