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

Method CheckComponents

Source/cmComputeTargetDepends.cxx:580–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578}
579
580bool cmComputeTargetDepends::CheckComponents(
581 cmComputeComponentGraph const& ccg)
582{
583 // All non-trivial components should consist only of static
584 // libraries.
585 std::vector<NodeList> const& components = ccg.GetComponents();
586 size_t nc = components.size();
587 for (size_t c = 0; c < nc; ++c) {
588 // Get the current component.
589 NodeList const& nl = components[c];
590
591 // Skip trivial components.
592 if (nl.size() < 2) {
593 continue;
594 }
595
596 // Immediately complain if no cycles are allowed at all.
597 if (this->NoCycles) {
598 this->ComplainAboutBadComponent(ccg, c);
599 return false;
600 }
601
602 // Make sure the component is all STATIC_LIBRARY targets.
603 for (size_t ni : nl) {
604 if (this->Targets[ni]->GetType() != cmStateEnums::STATIC_LIBRARY) {
605 this->ComplainAboutBadComponent(ccg, c);
606 return false;
607 }
608 }
609 }
610 return true;
611}
612
613void cmComputeTargetDepends::ComplainAboutBadComponent(
614 cmComputeComponentGraph const& ccg, size_t c, bool strong)

Callers 1

ComputeMethod · 0.95

Calls 3

sizeMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected