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

Method AppendDirectObjectLibs

Source/cmFastbuildNormalTargetGenerator.cxx:2023–2056  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2021}
2022
2023void cmFastbuildNormalTargetGenerator::AppendDirectObjectLibs(
2024 FastbuildLinkerNode& linkerNode, std::set<std::string>& linkedObjects)
2025{
2026 auto const srcs = this->GeneratorTarget->GetSourceFiles(Config);
2027 for (auto const& entry : srcs) {
2028 auto const objLib = entry.Value->GetObjectLibrary();
2029 auto const objPath = entry.Value->GetFullPath();
2030 LogMessage("Source obj entry: " + objPath);
2031 if (!objLib.empty()) {
2032 auto* const objTarget =
2033 this->LocalGenerator->FindGeneratorTargetToUse(objLib);
2034 if (objTarget) {
2035 LogMessage("Imported: " + std::to_string(objTarget->IsImported()));
2036 std::string fastbuildTarget;
2037 // If target is imported - we don't have it in our build file, so can't
2038 // refer to it by name. Use file path to the object then.
2039 // Tested in "ExportImport" test.
2040 if (objTarget->IsImported()) {
2041 fastbuildTarget = entry.Value->GetFullPath();
2042 } else {
2043 // Mark all target objects as linked.
2044 linkedObjects.emplace(this->ConvertToFastbuildPath(objPath));
2045 fastbuildTarget =
2046 objTarget->GetName() + FASTBUILD_OBJECTS_ALIAS_POSTFIX;
2047 }
2048 if (linkedObjects.emplace(fastbuildTarget).second) {
2049 LogMessage("Adding object target: " + fastbuildTarget);
2050 linkerNode.LibrarianAdditionalInputs.emplace_back(
2051 std::move(fastbuildTarget));
2052 }
2053 }
2054 }
2055 }
2056}
2057
2058void cmFastbuildNormalTargetGenerator::AppendLinkDeps(
2059 std::set<FastbuildTargetDep>& preBuildDeps, FastbuildLinkerNode& linkerNode,

Callers

nothing calls this directly

Calls 12

to_stringFunction · 0.85
moveFunction · 0.85
GetSourceFilesMethod · 0.80
GetObjectLibraryMethod · 0.80
emplaceMethod · 0.80
emplace_backMethod · 0.80
GetFullPathMethod · 0.45
emptyMethod · 0.45
IsImportedMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected