MCPcopy Create free account
hub / github.com/Kitware/CMake / ComputeTargetShortName

Method ComputeTargetShortName

Source/cmGlobalGenerator.cxx:2141–2151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2139}
2140
2141std::string cmGlobalGenerator::ComputeTargetShortName(
2142 std::string const& bindir, std::string const& targetName) const
2143{
2144 auto const& rcwbd =
2145 this->LocalGenerators[0]->MaybeRelativeToTopBinDir(bindir);
2146 cmCryptoHash hasher(cmCryptoHash::AlgoSHA3_512);
2147 constexpr size_t HASH_TRUNCATION = 4;
2148 auto dirHash = hasher.HashString(rcwbd).substr(0, HASH_TRUNCATION);
2149 auto tgtHash = hasher.HashString(targetName).substr(0, HASH_TRUNCATION);
2150 return cmStrCat(tgtHash, dirHash);
2151}
2152
2153cmGlobalGenerator::TargetDirectoryRegistration&
2154cmGlobalGenerator::RegisterTargetDirectory(cmGeneratorTarget const* tgt,

Callers 1

Calls 4

HashStringMethod · 0.80
cmStrCatFunction · 0.70
substrMethod · 0.45

Tested by

no test coverage detected