The link interface of MODULE libraries is empty (#11945)

MODULE libraries cannot be linked into other libraries and executables
(just like executables without ENABLE_EXPORTS).  Set the MODULE target
link interface to be empty.  This allows such targets to be installed in
an EXPORT set without including all their private implementation
dependencies.
This commit is contained in:
Brad King 2011-03-09 09:52:46 -05:00
parent 9ae65b866e
commit c6a8e4c71a
1 changed files with 7 additions and 3 deletions

View File

@ -4278,9 +4278,13 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface)
}
}
// There is no implicit link interface for executables, so if none
// was explicitly set, there is no link interface.
if(!explicitLibraries && this->GetType() == cmTarget::EXECUTABLE)
// There is no implicit link interface for executables or modules
// so if none was explicitly set then there is no link interface.
// Note that CMake versions 2.2 and below allowed linking to modules.
bool canLinkModules = this->Makefile->NeedBackwardsCompatibility(2,2);
if(!explicitLibraries &&
(this->GetType() == cmTarget::EXECUTABLE ||
this->GetType() == cmTarget::MODULE_LIBRARY && !canLinkModules))
{
return false;
}