mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-29 18:51:05 -05:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user