mirror of
https://github.com/reactos/CMake.git
synced 2025-01-08 12:10:29 +00:00
cmMakefile: Collapse two consecutive if()s into one
This commit is contained in:
parent
148b83a121
commit
2f6462a634
@ -1230,20 +1230,17 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
|
||||
}
|
||||
|
||||
cmTarget* tgt = this->GetGlobalGenerator()->FindTarget(lib);
|
||||
if (tgt) {
|
||||
// if it is not a static or shared library then you can not link to it
|
||||
if ((tgt->GetType() != cmState::STATIC_LIBRARY) &&
|
||||
(tgt->GetType() != cmState::SHARED_LIBRARY) &&
|
||||
(tgt->GetType() != cmState::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 STATIC or SHARED libraries, or "
|
||||
<< "to executables with the ENABLE_EXPORTS property set.";
|
||||
this->IssueMessage(cmake::FATAL_ERROR, e.str());
|
||||
}
|
||||
if (tgt && (tgt->GetType() != cmState::STATIC_LIBRARY) &&
|
||||
(tgt->GetType() != cmState::SHARED_LIBRARY) &&
|
||||
(tgt->GetType() != cmState::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 STATIC or SHARED libraries, or "
|
||||
<< "to executables with the ENABLE_EXPORTS property set.";
|
||||
this->IssueMessage(cmake::FATAL_ERROR, e.str());
|
||||
}
|
||||
i->second.AddLinkLibrary(*this, target, lib, llt);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user