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

Method VerifyLinkItemIsTarget

Source/cmGeneratorTarget_Link.cxx:464–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462}
463
464bool cmGeneratorTarget::VerifyLinkItemIsTarget(LinkItemRole role,
465 cmLinkItem const& item) const
466{
467 if (item.Target) {
468 return true;
469 }
470 std::string const& str = item.AsStr();
471 if (!str.empty() &&
472 (str[0] == '-' || str[0] == '$' || str[0] == '`' ||
473 str.find_first_of("/\\") != std::string::npos ||
474 cmHasPrefix(str, "<LINK_LIBRARY:"_s) ||
475 cmHasPrefix(str, "<LINK_GROUP:"_s))) {
476 return true;
477 }
478
479 std::string e = cmStrCat("Target \"", this->GetName(),
480 "\" has LINK_LIBRARIES_ONLY_TARGETS enabled, but ",
481 role == LinkItemRole::Implementation
482 ? "it links to"
483 : "its link interface contains",
484 ":\n ", item.AsStr(), "\nwhich is not a target. ",
485 missingTargetPossibleReasons);
486 cmListFileBacktrace backtrace = item.Backtrace;
487 if (backtrace.Empty()) {
488 backtrace = this->GetBacktrace();
489 }
490 this->LocalGenerator->GetCMakeInstance()->IssueMessage(
491 MessageType::FATAL_ERROR, e, backtrace);
492 return false;
493}
494
495bool cmGeneratorTarget::IsLinkLookupScope(std::string const& n,
496 cmLocalGenerator const*& lg) const

Callers 1

CheckLinkLibrariesMethod · 0.95

Calls 9

GetBacktraceMethod · 0.95
cmHasPrefixFunction · 0.85
find_first_ofMethod · 0.80
EmptyMethod · 0.80
cmStrCatFunction · 0.70
emptyMethod · 0.45
GetNameMethod · 0.45
IssueMessageMethod · 0.45
GetCMakeInstanceMethod · 0.45

Tested by

no test coverage detected