| 1693 | } |
| 1694 | |
| 1695 | void cmFastbuildNormalTargetGenerator::AppendExternalObject( |
| 1696 | FastbuildLinkerNode& linkerNode, std::set<std::string>& linkedDeps) const |
| 1697 | { |
| 1698 | // Different aspects of this logic exercised in "ObjectLibrary" and |
| 1699 | // "ExportImport" test. When making changes here - verify that both of those |
| 1700 | // tests are still passing. |
| 1701 | LogMessage("AppendExternalObject(...)"); |
| 1702 | std::vector<cmSourceFile const*> extObjects; |
| 1703 | this->GeneratorTarget->GetExternalObjects(extObjects, Config); |
| 1704 | for (cmSourceFile const* src : extObjects) { |
| 1705 | |
| 1706 | std::string const pathToObj = |
| 1707 | this->ConvertToFastbuildPath(src->GetFullPath()); |
| 1708 | LogMessage("EXT OBJ: " + pathToObj); |
| 1709 | std::string const objLibName = ResolveIfAlias(src->GetObjectLibrary()); |
| 1710 | LogMessage("GetObjectLibrary: " + objLibName); |
| 1711 | // Tested in "ExternalOBJ" test. |
| 1712 | cmTarget const* target = |
| 1713 | this->GlobalCommonGenerator->FindTarget(objLibName); |
| 1714 | if (objLibName.empty()) { |
| 1715 | linkerNode.LibrarianAdditionalInputs.emplace_back(pathToObj); |
| 1716 | } |
| 1717 | // We know how to generate this target and haven't added this dependency |
| 1718 | // yet. |
| 1719 | else if (target) { |
| 1720 | if (!linkedDeps.emplace(objLibName + FASTBUILD_OBJECTS_ALIAS_POSTFIX) |
| 1721 | .second) { |
| 1722 | LogMessage("Object Target: " + objLibName + |
| 1723 | FASTBUILD_OBJECTS_ALIAS_POSTFIX " already linked"); |
| 1724 | continue; |
| 1725 | } |
| 1726 | linkerNode.LibrarianAdditionalInputs.emplace_back( |
| 1727 | objLibName + FASTBUILD_OBJECTS_ALIAS_POSTFIX); |
| 1728 | } else if (linkedDeps.emplace(pathToObj).second) { |
| 1729 | LogMessage("Adding obj dep : " + pathToObj); |
| 1730 | linkerNode.LibrarianAdditionalInputs.emplace_back(pathToObj); |
| 1731 | } |
| 1732 | } |
| 1733 | } |
| 1734 | |
| 1735 | void cmFastbuildNormalTargetGenerator::AppendExeToLink( |
| 1736 | FastbuildLinkerNode& linkerNode, |
nothing calls this directly
no test coverage detected