summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetLinkLibrariesCommand.cxx
diff options
context:
space:
mode:
authorDeniz Bahadir <dbahadir@benocs.com>2017-11-24 16:20:18 (GMT)
committerBrad King <brad.king@kitware.com>2018-03-01 14:24:24 (GMT)
commitdfb6e84082884f908ffad4594d2712d9edfd2cc0 (patch)
treed553ea3a982588c523bc34115f19cbeebe34a74c /Source/cmTargetLinkLibrariesCommand.cxx
parent51249e69eaab33fe43805b9fe2262b4ddab01b56 (diff)
downloadCMake-dfb6e84082884f908ffad4594d2712d9edfd2cc0.zip
CMake-dfb6e84082884f908ffad4594d2712d9edfd2cc0.tar.gz
CMake-dfb6e84082884f908ffad4594d2712d9edfd2cc0.tar.bz2
objlib: Allow other libraries to link to `OBJECT` libraries.
Note: This only allows `OBJECT` libraries to be on the right-hand side of `target_link_libraries` but still does not link its object-files to the target on the left-hand side. Issue: #14778
Diffstat (limited to 'Source/cmTargetLinkLibrariesCommand.cxx')
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 47c29db..699fff8 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -391,14 +391,15 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
if (tgt && (tgt->GetType() != cmStateEnums::STATIC_LIBRARY) &&
(tgt->GetType() != cmStateEnums::SHARED_LIBRARY) &&
(tgt->GetType() != cmStateEnums::UNKNOWN_LIBRARY) &&
+ (tgt->GetType() != cmStateEnums::OBJECT_LIBRARY) &&
(tgt->GetType() != cmStateEnums::INTERFACE_LIBRARY) &&
!tgt->IsExecutableWithExports()) {
std::ostringstream e;
e << "Target \"" << lib << "\" of type "
<< cmState::GetTargetTypeName(tgt->GetType())
<< " may not be linked into another target. One may link only to "
- "INTERFACE, STATIC or SHARED libraries, or to executables with the "
- "ENABLE_EXPORTS property set.";
+ "INTERFACE, OBJECT, STATIC or SHARED libraries, or to executables "
+ "with the ENABLE_EXPORTS property set.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
}