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

Method AppendExternalObject

Source/cmFastbuildNormalTargetGenerator.cxx:1695–1733  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1693}
1694
1695void 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
1735void cmFastbuildNormalTargetGenerator::AppendExeToLink(
1736 FastbuildLinkerNode& linkerNode,

Callers

nothing calls this directly

Calls 8

GetExternalObjectsMethod · 0.80
GetObjectLibraryMethod · 0.80
FindTargetMethod · 0.80
emplace_backMethod · 0.80
emplaceMethod · 0.80
GetFullPathMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected