| 462 | } |
| 463 | |
| 464 | bool 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 | |
| 495 | bool cmGeneratorTarget::IsLinkLookupScope(std::string const& n, |
| 496 | cmLocalGenerator const*& lg) const |
no test coverage detected