| 348 | using EntryVector = cmComputeLinkDepends::EntryVector; |
| 349 | |
| 350 | EntriesProcessing(cmGeneratorTarget const* target, |
| 351 | std::string const& linkLanguage, EntryVector& entries, |
| 352 | EntryVector& finalEntries) |
| 353 | : Target(target) |
| 354 | , LinkLanguage(linkLanguage) |
| 355 | , Entries(entries) |
| 356 | , FinalEntries(finalEntries) |
| 357 | { |
| 358 | auto const* makefile = target->Makefile; |
| 359 | |
| 360 | switch (target->GetPolicyStatusCMP0156()) { |
| 361 | case cmPolicies::WARN: |
| 362 | if (!makefile->GetCMakeInstance()->GetIsInTryCompile() && |
| 363 | makefile->PolicyOptionalWarningEnabled( |
| 364 | "CMAKE_POLICY_WARNING_CMP0156")) { |
| 365 | makefile->GetCMakeInstance()->IssueMessage( |
| 366 | MessageType::AUTHOR_WARNING, |
| 367 | cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0156), |
| 368 | "\nSince the policy is not set, legacy libraries " |
| 369 | "de-duplication strategy will be applied."), |
| 370 | target->GetBacktrace()); |
| 371 | } |
| 372 | CM_FALLTHROUGH; |
| 373 | case cmPolicies::OLD: |
| 374 | // rely on default initialization of the class |
| 375 | break; |
| 376 | case cmPolicies::NEW: { |
| 377 | // Policy 0179 applies only when policy 0156 is new |
| 378 | if (target->GetPolicyStatusCMP0179() == cmPolicies::WARN && |
| 379 | !makefile->GetCMakeInstance()->GetIsInTryCompile() && |
| 380 | makefile->PolicyOptionalWarningEnabled( |
| 381 | "CMAKE_POLICY_WARNING_CMP0179")) { |
| 382 | makefile->GetCMakeInstance()->IssueMessage( |
| 383 | MessageType::AUTHOR_WARNING, |
| 384 | cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0179), |
| 385 | "\nSince the policy is not set, static libraries " |
| 386 | "de-duplication will keep the last occurrence of the " |
| 387 | "static libraries."), |
| 388 | target->GetBacktrace()); |
| 389 | } |
| 390 | |
| 391 | if (auto libProcessing = makefile->GetDefinition(cmStrCat( |
| 392 | "CMAKE_", linkLanguage, "_LINK_LIBRARIES_PROCESSING"))) { |
| 393 | // UNICITY keyword is just for compatibility with previous |
| 394 | // implementation |
| 395 | cmsys::RegularExpression processingOption{ |
| 396 | "^(ORDER|UNICITY|DEDUPLICATION)=(FORWARD|REVERSE|ALL|NONE|SHARED)$" |
| 397 | }; |
| 398 | std::string errorMessage; |
| 399 | for (auto const& option : cmList{ libProcessing }) { |
| 400 | if (processingOption.find(option)) { |
| 401 | if (processingOption.match(1) == "ORDER") { |
| 402 | if (processingOption.match(2) == "FORWARD") { |
| 403 | this->Order = Forward; |
| 404 | } else if (processingOption.match(2) == "REVERSE") { |
| 405 | this->Order = Reverse; |
| 406 | } else { |
| 407 | errorMessage += cmStrCat(" ", option, '\n'); |
nothing calls this directly
no test coverage detected