| 2021 | } |
| 2022 | |
| 2023 | void 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 | |
| 2058 | void cmFastbuildNormalTargetGenerator::AppendLinkDeps( |
| 2059 | std::set<FastbuildTargetDep>& preBuildDeps, FastbuildLinkerNode& linkerNode, |
nothing calls this directly
no test coverage detected