|
|
@@ -676,11 +676,14 @@ std::set<cmLinkItem> const& cmGeneratorTarget::GetUtilityItems() const
|
|
|
this->UtilityItemsDone = true;
|
|
|
std::set<std::string> const& utilities = this->GetUtilities();
|
|
|
for (std::string const& i : utilities) {
|
|
|
+ cmListFileBacktrace const* bt = this->GetUtilityBacktrace(i);
|
|
|
if (cmGeneratorTarget* gt =
|
|
|
this->LocalGenerator->FindGeneratorTargetToUse(i)) {
|
|
|
- this->UtilityItems.insert(cmLinkItem(gt));
|
|
|
+ this->UtilityItems.insert(
|
|
|
+ cmLinkItem(gt, bt ? *bt : cmListFileBacktrace()));
|
|
|
} else {
|
|
|
- this->UtilityItems.insert(cmLinkItem(i));
|
|
|
+ this->UtilityItems.insert(
|
|
|
+ cmLinkItem(i, bt ? *bt : cmListFileBacktrace()));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -4618,6 +4621,7 @@ void cmGeneratorTarget::ReportPropertyOrigin(
|
|
|
}
|
|
|
|
|
|
void cmGeneratorTarget::LookupLinkItems(std::vector<std::string> const& names,
|
|
|
+ cmListFileBacktrace const& bt,
|
|
|
std::vector<cmLinkItem>& items) const
|
|
|
{
|
|
|
for (std::string const& n : names) {
|
|
|
@@ -4625,7 +4629,7 @@ void cmGeneratorTarget::LookupLinkItems(std::vector<std::string> const& names,
|
|
|
if (name == this->GetName() || name.empty()) {
|
|
|
continue;
|
|
|
}
|
|
|
- items.push_back(this->ResolveLinkItem(name));
|
|
|
+ items.push_back(this->ResolveLinkItem(name, bt));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -4647,7 +4651,7 @@ void cmGeneratorTarget::ExpandLinkItems(
|
|
|
false, headTarget, this,
|
|
|
&dagChecker),
|
|
|
libs);
|
|
|
- this->LookupLinkItems(libs, items);
|
|
|
+ this->LookupLinkItems(libs, cge->GetBacktrace(), items);
|
|
|
hadHeadSensitiveCondition = cge->GetHadHeadSensitiveCondition();
|
|
|
}
|
|
|
|
|
|
@@ -5200,7 +5204,7 @@ const cmLinkInterface* cmGeneratorTarget::GetImportLinkInterface(
|
|
|
iface.HadHeadSensitiveCondition);
|
|
|
std::vector<std::string> deps;
|
|
|
cmSystemTools::ExpandListArgument(info->SharedDeps, deps);
|
|
|
- this->LookupLinkItems(deps, iface.SharedDeps);
|
|
|
+ this->LookupLinkItems(deps, cmListFileBacktrace(), iface.SharedDeps);
|
|
|
}
|
|
|
|
|
|
return &iface;
|
|
|
@@ -5736,7 +5740,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
|
|
|
}
|
|
|
|
|
|
// The entry is meant for this configuration.
|
|
|
- impl.Libraries.emplace_back(this->ResolveLinkItem(name), *btIt,
|
|
|
+ impl.Libraries.emplace_back(this->ResolveLinkItem(name, *btIt),
|
|
|
evaluated != *le);
|
|
|
}
|
|
|
|
|
|
@@ -5764,7 +5768,8 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
|
|
|
continue;
|
|
|
}
|
|
|
// Support OLD behavior for CMP0003.
|
|
|
- impl.WrongConfigLibraries.push_back(this->ResolveLinkItem(name));
|
|
|
+ impl.WrongConfigLibraries.push_back(
|
|
|
+ this->ResolveLinkItem(name, cmListFileBacktrace()));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -5811,12 +5816,13 @@ cmGeneratorTarget::TargetOrString cmGeneratorTarget::ResolveTargetReference(
|
|
|
return resolved;
|
|
|
}
|
|
|
|
|
|
-cmLinkItem cmGeneratorTarget::ResolveLinkItem(std::string const& name) const
|
|
|
+cmLinkItem cmGeneratorTarget::ResolveLinkItem(
|
|
|
+ std::string const& name, cmListFileBacktrace const& bt) const
|
|
|
{
|
|
|
TargetOrString resolved = this->ResolveTargetReference(name);
|
|
|
|
|
|
if (!resolved.Target) {
|
|
|
- return cmLinkItem(resolved.String);
|
|
|
+ return cmLinkItem(resolved.String, bt);
|
|
|
}
|
|
|
|
|
|
// Skip targets that will not really be linked. This is probably a
|
|
|
@@ -5824,10 +5830,10 @@ cmLinkItem cmGeneratorTarget::ResolveLinkItem(std::string const& name) const
|
|
|
// within the project.
|
|
|
if (resolved.Target->GetType() == cmStateEnums::EXECUTABLE &&
|
|
|
!resolved.Target->IsExecutableWithExports()) {
|
|
|
- return cmLinkItem(resolved.Target->GetName());
|
|
|
+ return cmLinkItem(resolved.Target->GetName(), bt);
|
|
|
}
|
|
|
|
|
|
- return cmLinkItem(resolved.Target);
|
|
|
+ return cmLinkItem(resolved.Target, bt);
|
|
|
}
|
|
|
|
|
|
std::string cmGeneratorTarget::GetPDBDirectory(const std::string& config) const
|