|
@@ -2073,6 +2073,8 @@ void cmFastbuildNormalTargetGenerator::AppendLinkDeps(
|
|
|
for (cmComputeLinkInformation::Item const& item : items) {
|
|
for (cmComputeLinkInformation::Item const& item : items) {
|
|
|
std::string const feature = item.GetFeatureName();
|
|
std::string const feature = item.GetFeatureName();
|
|
|
LogMessage("GetFeatureName: " + feature);
|
|
LogMessage("GetFeatureName: " + feature);
|
|
|
|
|
+ std::string const formatted =
|
|
|
|
|
+ item.GetFormattedItem(item.Value.Value).Value;
|
|
|
if (!feature.empty()) {
|
|
if (!feature.empty()) {
|
|
|
LogMessage("GetFormattedItem: " +
|
|
LogMessage("GetFormattedItem: " +
|
|
|
item.GetFormattedItem(item.Value.Value).Value);
|
|
item.GetFormattedItem(item.Value.Value).Value);
|
|
@@ -2083,13 +2085,26 @@ void cmFastbuildNormalTargetGenerator::AppendLinkDeps(
|
|
|
if (item.ObjectSource &&
|
|
if (item.ObjectSource &&
|
|
|
linkerNode.Type != FastbuildLinkerNode::STATIC_LIBRARY) {
|
|
linkerNode.Type != FastbuildLinkerNode::STATIC_LIBRARY) {
|
|
|
// Tested in "ObjectLibrary" test.
|
|
// Tested in "ObjectLibrary" test.
|
|
|
- auto libName = item.ObjectSource->GetObjectLibrary();
|
|
|
|
|
|
|
+ std::string const libName = item.ObjectSource->GetObjectLibrary();
|
|
|
std::string dep = libName + FASTBUILD_OBJECTS_ALIAS_POSTFIX;
|
|
std::string dep = libName + FASTBUILD_OBJECTS_ALIAS_POSTFIX;
|
|
|
if (linkedObjects.emplace(dep).second) {
|
|
if (linkedObjects.emplace(dep).second) {
|
|
|
- FastbuildTargetDep targetDep{ std::move(libName) };
|
|
|
|
|
|
|
+ FastbuildTargetDep targetDep{ libName };
|
|
|
targetDep.Type = FastbuildTargetDepType::ORDER_ONLY;
|
|
targetDep.Type = FastbuildTargetDepType::ORDER_ONLY;
|
|
|
preBuildDeps.emplace(std::move(targetDep));
|
|
preBuildDeps.emplace(std::move(targetDep));
|
|
|
- linkerNode.LibrarianAdditionalInputs.emplace_back(std::move(dep));
|
|
|
|
|
|
|
+
|
|
|
|
|
+ cmTarget const* importedTarget =
|
|
|
|
|
+ this->LocalGenerator->GetMakefile()->FindImportedTarget(libName);
|
|
|
|
|
+ // Add direct path to the object for imported target
|
|
|
|
|
+ // since such targets are not defined in fbuild.bff file.
|
|
|
|
|
+ if (importedTarget) {
|
|
|
|
|
+ LogMessage(
|
|
|
|
|
+ cmStrCat("Adding ", formatted, " to LibrarianAdditionalInputs"));
|
|
|
|
|
+ linkerNode.LibrarianAdditionalInputs.emplace_back(formatted);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ LogMessage(
|
|
|
|
|
+ cmStrCat("Adding ", dep, " to LibrarianAdditionalInputs"));
|
|
|
|
|
+ linkerNode.LibrarianAdditionalInputs.emplace_back(std::move(dep));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
} else if (linkerNode.Type == FastbuildLinkerNode::STATIC_LIBRARY) {
|
|
} else if (linkerNode.Type == FastbuildLinkerNode::STATIC_LIBRARY) {
|
|
|
LogMessage("Skipping linking to STATIC_LIBRARY (" + linkerNode.Name +
|
|
LogMessage("Skipping linking to STATIC_LIBRARY (" + linkerNode.Name +
|