objlib: Allow OBJECT libraries to link to other libraries.

The proper way to use libraries is now through `target_link_libraries`
for things such as usage requirements, compile definitions, include
directories, etc. To facilitate this, allow `OBJECT` libraries to "link"
to other libraries.

Co-Author: Ben Boeckel <ben.boeckel@kitware.com>
Issue: #14778
This commit is contained in:
Deniz Bahadir
2017-11-23 12:59:20 +01:00
committed by Brad King
parent e22c45d4c9
commit 51249e69ea
10 changed files with 39 additions and 22 deletions
-10
View File
@@ -94,16 +94,6 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
return true;
}
// OBJECT libraries are not allowed on the LHS of the command.
if (this->Target->GetType() == cmStateEnums::OBJECT_LIBRARY) {
std::ostringstream e;
e << "Object library target \"" << args[0] << "\" "
<< "may not link to anything.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
cmSystemTools::SetFatalErrorOccured();
return true;
}
// Having a UTILITY library on the LHS is a bug.
if (this->Target->GetType() == cmStateEnums::UTILITY) {
std::ostringstream e;