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

Method GetCustomCommandTargetName

Source/cmFastbuildTargetGenerator.cxx:139–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139std::string cmFastbuildTargetGenerator::GetCustomCommandTargetName(
140 cmCustomCommand const& cc, FastbuildBuildStep step) const
141{
142 std::string const extra = this->Makefile->GetCurrentBinaryDirectory();
143 std::string targetName = "cc";
144
145 std::string extras = extra;
146
147 // Compute hash based on commands & args & output.
148 for (cmCustomCommandLine const& commandLine : cc.GetCommandLines()) {
149 extras += cmJoin(commandLine, "");
150 }
151 for (std::string const& output : cc.GetOutputs()) {
152 extras += output;
153 }
154
155 extras += std::to_string(static_cast<int>(step));
156
157 cmCryptoHash hash(cmCryptoHash::AlgoSHA256);
158 targetName += "-" + hash.HashString(extras).substr(0, 14);
159
160 return targetName;
161}
162
163void cmFastbuildTargetGenerator::WriteScriptProlog(cmsys::ofstream& file) const
164{

Callers 1

GetDependsMethod · 0.95

Calls 4

to_stringFunction · 0.85
HashStringMethod · 0.80
cmJoinFunction · 0.70
substrMethod · 0.45

Tested by

no test coverage detected