|
@@ -6346,11 +6346,11 @@ bool cmGeneratorTarget::IsLinkLookupScope(std::string const& n,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
cm::optional<cmLinkItem> cmGeneratorTarget::LookupLinkItem(
|
|
cm::optional<cmLinkItem> cmGeneratorTarget::LookupLinkItem(
|
|
|
- std::string const& n, cmListFileBacktrace const& bt) const
|
|
|
|
|
|
|
+ std::string const& n, cmListFileBacktrace const& bt,
|
|
|
|
|
+ LookupLinkItemScope* scope) const
|
|
|
{
|
|
{
|
|
|
cm::optional<cmLinkItem> maybeItem;
|
|
cm::optional<cmLinkItem> maybeItem;
|
|
|
- cmLocalGenerator const* lg = this->LocalGenerator;
|
|
|
|
|
- if (this->IsLinkLookupScope(n, lg)) {
|
|
|
|
|
|
|
+ if (this->IsLinkLookupScope(n, scope->LG)) {
|
|
|
return maybeItem;
|
|
return maybeItem;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -6358,7 +6358,7 @@ cm::optional<cmLinkItem> cmGeneratorTarget::LookupLinkItem(
|
|
|
if (name == this->GetName() || name.empty()) {
|
|
if (name == this->GetName() || name.empty()) {
|
|
|
return maybeItem;
|
|
return maybeItem;
|
|
|
}
|
|
}
|
|
|
- maybeItem = this->ResolveLinkItem(name, bt, lg);
|
|
|
|
|
|
|
+ maybeItem = this->ResolveLinkItem(name, bt, scope->LG);
|
|
|
return maybeItem;
|
|
return maybeItem;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -6385,9 +6385,10 @@ void cmGeneratorTarget::ExpandLinkItems(
|
|
|
&dagChecker, this, headTarget->LinkerLanguage),
|
|
&dagChecker, this, headTarget->LinkerLanguage),
|
|
|
libs);
|
|
libs);
|
|
|
cmMakefile const* mf = this->LocalGenerator->GetMakefile();
|
|
cmMakefile const* mf = this->LocalGenerator->GetMakefile();
|
|
|
|
|
+ LookupLinkItemScope scope{ this->LocalGenerator };
|
|
|
for (std::string const& lib : libs) {
|
|
for (std::string const& lib : libs) {
|
|
|
if (cm::optional<cmLinkItem> maybeItem =
|
|
if (cm::optional<cmLinkItem> maybeItem =
|
|
|
- this->LookupLinkItem(lib, cge->GetBacktrace())) {
|
|
|
|
|
|
|
+ this->LookupLinkItem(lib, cge->GetBacktrace(), &scope)) {
|
|
|
if (!maybeItem->Target) {
|
|
if (!maybeItem->Target) {
|
|
|
// Report explicitly linked object files separately.
|
|
// Report explicitly linked object files separately.
|
|
|
std::string const& maybeObj = maybeItem->AsStr();
|
|
std::string const& maybeObj = maybeItem->AsStr();
|
|
@@ -7089,9 +7090,10 @@ const cmLinkInterface* cmGeneratorTarget::GetImportLinkInterface(
|
|
|
iface.HadContextSensitiveCondition,
|
|
iface.HadContextSensitiveCondition,
|
|
|
iface.HadLinkLanguageSensitiveCondition);
|
|
iface.HadLinkLanguageSensitiveCondition);
|
|
|
std::vector<std::string> deps = cmExpandedList(info->SharedDeps);
|
|
std::vector<std::string> deps = cmExpandedList(info->SharedDeps);
|
|
|
|
|
+ LookupLinkItemScope scope{ this->LocalGenerator };
|
|
|
for (std::string const& dep : deps) {
|
|
for (std::string const& dep : deps) {
|
|
|
if (cm::optional<cmLinkItem> maybeItem =
|
|
if (cm::optional<cmLinkItem> maybeItem =
|
|
|
- this->LookupLinkItem(dep, cmListFileBacktrace())) {
|
|
|
|
|
|
|
+ this->LookupLinkItem(dep, cmListFileBacktrace(), &scope)) {
|
|
|
iface.SharedDeps.emplace_back(std::move(*maybeItem));
|
|
iface.SharedDeps.emplace_back(std::move(*maybeItem));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|