| 458 | } |
| 459 | |
| 460 | void AddLibraries(std::vector<size_t> const& libEntries) |
| 461 | { |
| 462 | if (this->Order == Reverse) { |
| 463 | std::vector<size_t> entries; |
| 464 | if (this->Deduplication == All && |
| 465 | this->Target->GetPolicyStatusCMP0179() == cmPolicies::NEW) { |
| 466 | // keep the first occurrence of the static libraries |
| 467 | std::set<size_t> emitted{ this->Emitted }; |
| 468 | for (auto index : libEntries) { |
| 469 | LinkEntry const& entry = this->Entries[index]; |
| 470 | if (!entry.Target || |
| 471 | entry.Target->GetType() != cmStateEnums::STATIC_LIBRARY) { |
| 472 | entries.emplace_back(index); |
| 473 | continue; |
| 474 | } |
| 475 | if (this->IncludeEntry(entry) || emitted.insert(index).second) { |
| 476 | entries.emplace_back(index); |
| 477 | } |
| 478 | } |
| 479 | } else { |
| 480 | entries = libEntries; |
| 481 | } |
| 482 | // Iterate in reverse order so we can keep only the last occurrence |
| 483 | // of the shared libraries. |
| 484 | this->AddLibraries(cmReverseRange(entries)); |
| 485 | } else { |
| 486 | this->AddLibraries(cmMakeRange(libEntries)); |
| 487 | } |
| 488 | } |
| 489 | |
| 490 | void AddObjects(std::vector<size_t> const& objectEntries) |
| 491 | { |
no test coverage detected