summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-10-07 18:13:34 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-10-07 18:13:34 (GMT)
commit2f6462a634726d9d0ea8d8552454839d67183016 (patch)
treedb3f40d1c44f238cf121832c557af5e48195ac88 /Source/cmMakefile.cxx
parent148b83a12185d7611ff7576464087430c3f2719c (diff)
downloadCMake-2f6462a634726d9d0ea8d8552454839d67183016.zip
CMake-2f6462a634726d9d0ea8d8552454839d67183016.tar.gz
CMake-2f6462a634726d9d0ea8d8552454839d67183016.tar.bz2
cmMakefile: Collapse two consecutive if()s into one
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx25
1 files changed, 11 insertions, 14 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8716696..c8446ac 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -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);
}