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

Method AddTargetDepend

Source/cmComputeTargetDepends.cxx:345–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343}
344
345void cmComputeTargetDepends::AddTargetDepend(size_t depender_index,
346 cmLinkItem const& dependee_name,
347 bool linking, bool cross,
348 std::set<cmLinkItem>& emitted)
349{
350 // Get the depender.
351 cmGeneratorTarget const* depender = this->Targets[depender_index];
352
353 // Check the target's makefile first.
354 cmGeneratorTarget const* dependee = dependee_name.Target;
355
356 if (!dependee && !linking &&
357 (depender->GetType() != cmStateEnums::GLOBAL_TARGET)) {
358 this->GlobalGenerator->GetCMakeInstance()->IssueMessage(
359 MessageType::FATAL_ERROR,
360 cmStrCat("The dependency target \"", dependee_name.AsStr(),
361 "\" of target \"", depender->GetName(), "\" does not exist."),
362 dependee_name.Backtrace);
363 }
364
365 // Skip targets that will not really be linked. This is probably a
366 // name conflict between an external library and an executable
367 // within the project.
368 if (linking && dependee && dependee->GetType() == cmStateEnums::EXECUTABLE &&
369 !dependee->IsExecutableWithExports()) {
370 dependee = nullptr;
371 }
372
373 if (dependee) {
374 this->AddTargetDepend(depender_index, dependee, dependee_name.Backtrace,
375 linking, cross, emitted);
376 }
377}
378
379void cmComputeTargetDepends::AddTargetDepend(
380 size_t depender_index, cmGeneratorTarget const* dependee,

Callers 2

CollectTargetDependsMethod · 0.95
AddInterfaceDependsMethod · 0.95

Calls 11

IsInBuildSystemMethod · 0.80
emplace_backMethod · 0.80
cmStrCatFunction · 0.70
GetTypeMethod · 0.45
IssueMessageMethod · 0.45
GetCMakeInstanceMethod · 0.45
GetNameMethod · 0.45
insertMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected