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

Method GetDepends

Source/cmFastbuildTargetGenerator.cxx:351–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349}
350
351void cmFastbuildTargetGenerator::GetDepends(
352 cmCustomCommandGenerator const& ccg, std::string const& currentCCName,
353 std::vector<std::string>& fileLevelDeps,
354 std::set<FastbuildTargetDep>& targetDep) const
355{
356 for (auto dep : ccg.GetDepends()) {
357 LogMessage("Dep: " + dep);
358 auto orig = dep;
359 if (this->LocalCommonGenerator->GetRealDependency(dep, Config, dep)) {
360 LogMessage("Real dep: " + dep);
361 if (!dep.empty()) {
362 LogMessage("Custom command real dep: " + dep);
363 for (auto const& item : cmList{ cmGeneratorExpression::Evaluate(
364 this->ConvertToFastbuildPath(dep), this->LocalGenerator,
365 Config) }) {
366 fileLevelDeps.emplace_back(item);
367 }
368 }
369 }
370 dep = this->ConvertToFastbuildPath(dep);
371 LogMessage("Real dep converted: " + dep);
372
373 auto const targetInfo = this->LocalGenerator->GetSourcesWithOutput(dep);
374 if (targetInfo.Target) {
375 LogMessage(
376 cmStrCat("dep: ", dep, ", target: ", targetInfo.Target->GetName()));
377 auto const& target = targetInfo.Target;
378 auto const processCCs = [this, &currentCCName, &targetDep,
379 dep](std::vector<cmCustomCommand> const& ccs,
380 FastbuildBuildStep step) {
381 for (auto const& cc : ccs) {
382 for (auto const& output : cc.GetOutputs()) {
383 LogMessage(cmStrCat("dep: ", dep, ", post output: ",
384 this->ConvertToFastbuildPath(output)));
385 if (this->ConvertToFastbuildPath(output) == dep) {
386 auto ccName = this->GetCustomCommandTargetName(cc, step);
387 if (ccName != currentCCName) {
388 LogMessage("Additional CC dep from target: " + ccName);
389 targetDep.emplace(std::move(ccName));
390 }
391 }
392 }
393 for (auto const& byproduct : cc.GetByproducts()) {
394 LogMessage(cmStrCat("dep: ", dep, ", post byproduct: ",
395 this->ConvertToFastbuildPath(byproduct)));
396 if (this->ConvertToFastbuildPath(byproduct) == dep) {
397 auto ccName = this->GetCustomCommandTargetName(cc, step);
398 if (ccName != currentCCName) {
399 LogMessage("Additional CC dep from target: " + ccName);
400 targetDep.emplace(std::move(ccName));
401 }
402 }
403 }
404 }
405 };
406 processCCs(target->GetPreBuildCommands(), FastbuildBuildStep::PRE_BUILD);
407 processCCs(target->GetPreLinkCommands(), FastbuildBuildStep::PRE_LINK);
408 processCCs(target->GetPostBuildCommands(),

Callers 15

AddUtilityCommandMethod · 0.80
AppendTargetDependsMethod · 0.80
AppendCustomDependMethod · 0.80
ComputeLinkDepsMethod · 0.80
AddUtilityCommandMethod · 0.80
TraceMethod · 0.80
CheckCustomCommandMethod · 0.80
VisitCustomCommandMethod · 0.80

Calls 11

moveFunction · 0.85
GetRealDependencyMethod · 0.80
emplace_backMethod · 0.80
GetSourcesWithOutputMethod · 0.80
emplaceMethod · 0.80
GetCustomCommandMethod · 0.80
cmStrCatFunction · 0.70
emptyMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected