mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 00:11:07 -06:00
cmLinkItem: Remove now-unused fields from link interfaces
With CMP0022 removed, a link interface is now always explicit if it exists. It is also never derived from the link implementation.
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
#include "cmFindPackageStack.h"
|
||||
#include "cmGeneratedFileStream.h"
|
||||
#include "cmGeneratorTarget.h"
|
||||
#include "cmLinkItem.h"
|
||||
#include "cmLocalGenerator.h"
|
||||
#include "cmMakefile.h"
|
||||
#include "cmMessageType.h"
|
||||
@@ -29,6 +28,8 @@
|
||||
#include "cmValue.h"
|
||||
#include "cmVersion.h"
|
||||
|
||||
struct cmLinkInterface;
|
||||
|
||||
static std::string cmExportFileGeneratorEscape(std::string const& str)
|
||||
{
|
||||
// Escape a property value for writing into a .cmake file.
|
||||
@@ -110,14 +111,6 @@ void cmExportCMakeConfigGenerator::SetImportLinkInterface(
|
||||
return;
|
||||
}
|
||||
|
||||
if (iface->ImplementationIsInterface) {
|
||||
// Policy CMP0022 must not be NEW.
|
||||
this->SetImportLinkProperty(
|
||||
suffix, target, "IMPORTED_LINK_INTERFACE_LIBRARIES", iface->Libraries,
|
||||
properties, ImportLinkPropertyTargetNames::Yes);
|
||||
return;
|
||||
}
|
||||
|
||||
cmValue propContent;
|
||||
|
||||
if (cmValue prop_suffixed =
|
||||
|
||||
@@ -680,32 +680,30 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
|
||||
cmOptionalLinkInterface& iface,
|
||||
bool secondPass) const
|
||||
{
|
||||
if (iface.Explicit) {
|
||||
if (this->GetType() == cmStateEnums::SHARED_LIBRARY ||
|
||||
this->GetType() == cmStateEnums::STATIC_LIBRARY ||
|
||||
this->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
|
||||
// Shared libraries may have runtime implementation dependencies
|
||||
// on other shared libraries that are not in the interface.
|
||||
std::set<cmLinkItem> emitted;
|
||||
for (cmLinkItem const& lib : iface.Libraries) {
|
||||
emitted.insert(lib);
|
||||
}
|
||||
if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
|
||||
cmLinkImplementation const* impl =
|
||||
this->GetLinkImplementation(config, UseTo::Link, secondPass);
|
||||
for (cmLinkImplItem const& lib : impl->Libraries) {
|
||||
if (emitted.insert(lib).second) {
|
||||
if (lib.Target) {
|
||||
// This is a runtime dependency on another shared library.
|
||||
if (lib.Target->GetType() == cmStateEnums::SHARED_LIBRARY) {
|
||||
iface.SharedDeps.push_back(lib);
|
||||
}
|
||||
} else {
|
||||
// TODO: Recognize shared library file names. Perhaps this
|
||||
// should be moved to cmComputeLinkInformation, but that
|
||||
// creates a chicken-and-egg problem since this list is needed
|
||||
// for its construction.
|
||||
if (this->GetType() == cmStateEnums::SHARED_LIBRARY ||
|
||||
this->GetType() == cmStateEnums::STATIC_LIBRARY ||
|
||||
this->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
|
||||
// Shared libraries may have runtime implementation dependencies
|
||||
// on other shared libraries that are not in the interface.
|
||||
std::set<cmLinkItem> emitted;
|
||||
for (cmLinkItem const& lib : iface.Libraries) {
|
||||
emitted.insert(lib);
|
||||
}
|
||||
if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
|
||||
cmLinkImplementation const* impl =
|
||||
this->GetLinkImplementation(config, UseTo::Link, secondPass);
|
||||
for (cmLinkImplItem const& lib : impl->Libraries) {
|
||||
if (emitted.insert(lib).second) {
|
||||
if (lib.Target) {
|
||||
// This is a runtime dependency on another shared library.
|
||||
if (lib.Target->GetType() == cmStateEnums::SHARED_LIBRARY) {
|
||||
iface.SharedDeps.push_back(lib);
|
||||
}
|
||||
} else {
|
||||
// TODO: Recognize shared library file names. Perhaps this
|
||||
// should be moved to cmComputeLinkInformation, but that
|
||||
// creates a chicken-and-egg problem since this list is needed
|
||||
// for its construction.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -805,7 +803,6 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries(
|
||||
return;
|
||||
}
|
||||
iface.Exists = true;
|
||||
iface.Explicit = true;
|
||||
|
||||
// The interface libraries are specified by INTERFACE_LINK_LIBRARIES.
|
||||
// Use its special representation directly to get backtraces.
|
||||
|
||||
@@ -104,8 +104,6 @@ struct cmLinkInterface : public cmLinkInterfaceLibraries
|
||||
// or more static libraries.
|
||||
unsigned int Multiplicity = 0;
|
||||
|
||||
bool ImplementationIsInterface = false;
|
||||
|
||||
// Whether the list depends on a link language genex.
|
||||
bool HadLinkLanguageSensitiveCondition = false;
|
||||
};
|
||||
@@ -115,7 +113,6 @@ struct cmOptionalLinkInterface : public cmLinkInterface
|
||||
bool LibrariesDone = false;
|
||||
bool AllDone = false;
|
||||
bool Exists = false;
|
||||
bool Explicit = false;
|
||||
bool CheckLinkLibraries = false;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user