|
|
@ -54,6 +54,20 @@ const std::string kINTERFACE_LINK_LIBRARIES_DIRECT =
|
|
|
|
"INTERFACE_LINK_LIBRARIES_DIRECT";
|
|
|
|
"INTERFACE_LINK_LIBRARIES_DIRECT";
|
|
|
|
const std::string kINTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE =
|
|
|
|
const std::string kINTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE =
|
|
|
|
"INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE";
|
|
|
|
"INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int CheckLinkLibrariesSuppressionRAIICount;
|
|
|
|
|
|
|
|
void MaybeEnableCheckLinkLibraries(cmOptionalLinkImplementation& impl)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (CheckLinkLibrariesSuppressionRAIICount == 0) {
|
|
|
|
|
|
|
|
impl.CheckLinkLibraries = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void MaybeEnableCheckLinkLibraries(cmOptionalLinkInterface& iface)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (CheckLinkLibrariesSuppressionRAIICount == 0) {
|
|
|
|
|
|
|
|
iface.CheckLinkLibraries = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class cmTargetCollectLinkLanguages
|
|
|
|
class cmTargetCollectLinkLanguages
|
|
|
@ -372,7 +386,8 @@ void cmGeneratorTarget::CheckLinkLibraries() const
|
|
|
|
// There could be several entries used when computing the pre-CMP0022
|
|
|
|
// There could be several entries used when computing the pre-CMP0022
|
|
|
|
// default link interface. Check only the entry for our own link impl.
|
|
|
|
// default link interface. Check only the entry for our own link impl.
|
|
|
|
auto const hmi = hm.find(this);
|
|
|
|
auto const hmi = hm.find(this);
|
|
|
|
if (hmi == hm.end() || !hmi->second.LibrariesDone) {
|
|
|
|
if (hmi == hm.end() || !hmi->second.LibrariesDone ||
|
|
|
|
|
|
|
|
!hmi->second.CheckLinkLibraries) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (cmLinkImplItem const& item : hmi->second.Libraries) {
|
|
|
|
for (cmLinkImplItem const& item : hmi->second.Libraries) {
|
|
|
@ -392,7 +407,7 @@ void cmGeneratorTarget::CheckLinkLibraries() const
|
|
|
|
// should be a subset of LinkInterfaceMap (with LINK_ONLY left out).
|
|
|
|
// should be a subset of LinkInterfaceMap (with LINK_ONLY left out).
|
|
|
|
for (auto const& hmp : this->LinkInterfaceMap) {
|
|
|
|
for (auto const& hmp : this->LinkInterfaceMap) {
|
|
|
|
for (auto const& hmi : hmp.second) {
|
|
|
|
for (auto const& hmi : hmp.second) {
|
|
|
|
if (!hmi.second.LibrariesDone) {
|
|
|
|
if (!hmi.second.LibrariesDone || !hmi.second.CheckLinkLibraries) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (cmLinkItem const& item : hmi.second.Libraries) {
|
|
|
|
for (cmLinkItem const& item : hmi.second.Libraries) {
|
|
|
@ -408,6 +423,18 @@ void cmGeneratorTarget::CheckLinkLibraries() const
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmGeneratorTarget::CheckLinkLibrariesSuppressionRAII::
|
|
|
|
|
|
|
|
CheckLinkLibrariesSuppressionRAII()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
++CheckLinkLibrariesSuppressionRAIICount;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmGeneratorTarget::CheckLinkLibrariesSuppressionRAII::
|
|
|
|
|
|
|
|
~CheckLinkLibrariesSuppressionRAII()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
--CheckLinkLibrariesSuppressionRAIICount;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
namespace {
|
|
|
|
cm::string_view missingTargetPossibleReasons =
|
|
|
|
cm::string_view missingTargetPossibleReasons =
|
|
|
|
"Possible reasons include:\n"
|
|
|
|
"Possible reasons include:\n"
|
|
|
@ -642,6 +669,7 @@ cmLinkInterface const* cmGeneratorTarget::GetLinkInterface(
|
|
|
|
if (secondPass) {
|
|
|
|
if (secondPass) {
|
|
|
|
iface = cmOptionalLinkInterface();
|
|
|
|
iface = cmOptionalLinkInterface();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MaybeEnableCheckLinkLibraries(iface);
|
|
|
|
if (!iface.LibrariesDone) {
|
|
|
|
if (!iface.LibrariesDone) {
|
|
|
|
iface.LibrariesDone = true;
|
|
|
|
iface.LibrariesDone = true;
|
|
|
|
this->ComputeLinkInterfaceLibraries(config, iface, head, UseTo::Link);
|
|
|
|
this->ComputeLinkInterfaceLibraries(config, iface, head, UseTo::Link);
|
|
|
@ -765,6 +793,7 @@ const cmLinkInterfaceLibraries* cmGeneratorTarget::GetLinkInterfaceLibraries(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
cmOptionalLinkInterface& iface = hm[head];
|
|
|
|
cmOptionalLinkInterface& iface = hm[head];
|
|
|
|
|
|
|
|
MaybeEnableCheckLinkLibraries(iface);
|
|
|
|
if (!iface.LibrariesDone) {
|
|
|
|
if (!iface.LibrariesDone) {
|
|
|
|
iface.LibrariesDone = true;
|
|
|
|
iface.LibrariesDone = true;
|
|
|
|
this->ComputeLinkInterfaceLibraries(config, iface, head, usage);
|
|
|
|
this->ComputeLinkInterfaceLibraries(config, iface, head, usage);
|
|
|
@ -1034,6 +1063,7 @@ const cmLinkInterface* cmGeneratorTarget::GetImportLinkInterface(
|
|
|
|
if (secondPass) {
|
|
|
|
if (secondPass) {
|
|
|
|
iface = cmOptionalLinkInterface();
|
|
|
|
iface = cmOptionalLinkInterface();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MaybeEnableCheckLinkLibraries(iface);
|
|
|
|
if (!iface.AllDone) {
|
|
|
|
if (!iface.AllDone) {
|
|
|
|
iface.AllDone = true;
|
|
|
|
iface.AllDone = true;
|
|
|
|
iface.LibrariesDone = true;
|
|
|
|
iface.LibrariesDone = true;
|
|
|
@ -1106,6 +1136,7 @@ const cmLinkImplementation* cmGeneratorTarget::GetLinkImplementation(
|
|
|
|
if (secondPass) {
|
|
|
|
if (secondPass) {
|
|
|
|
impl = cmOptionalLinkImplementation();
|
|
|
|
impl = cmOptionalLinkImplementation();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MaybeEnableCheckLinkLibraries(impl);
|
|
|
|
if (!impl.LibrariesDone) {
|
|
|
|
if (!impl.LibrariesDone) {
|
|
|
|
impl.LibrariesDone = true;
|
|
|
|
impl.LibrariesDone = true;
|
|
|
|
this->ComputeLinkImplementationLibraries(config, impl, this, usage);
|
|
|
|
this->ComputeLinkImplementationLibraries(config, impl, this, usage);
|
|
|
@ -1162,6 +1193,7 @@ cmGeneratorTarget::GetLinkImplementationLibrariesInternal(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
cmOptionalLinkImplementation& impl = hm[head];
|
|
|
|
cmOptionalLinkImplementation& impl = hm[head];
|
|
|
|
|
|
|
|
MaybeEnableCheckLinkLibraries(impl);
|
|
|
|
if (!impl.LibrariesDone) {
|
|
|
|
if (!impl.LibrariesDone) {
|
|
|
|
impl.LibrariesDone = true;
|
|
|
|
impl.LibrariesDone = true;
|
|
|
|
this->ComputeLinkImplementationLibraries(config, impl, head, usage);
|
|
|
|
this->ComputeLinkImplementationLibraries(config, impl, head, usage);
|
|
|
|