summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-10-07 18:13:37 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-10-07 20:08:03 (GMT)
commita1cfc4fe3deed4d642773d0ae63dd524c3f2eba1 (patch)
treee3add63b37d887b29964289857acd930927b3c9d /Source/cmMakefile.cxx
parent4079ba20d9d9c8d15fd28d9440d56c907dda811c (diff)
downloadCMake-a1cfc4fe3deed4d642773d0ae63dd524c3f2eba1.zip
CMake-a1cfc4fe3deed4d642773d0ae63dd524c3f2eba1.tar.gz
CMake-a1cfc4fe3deed4d642773d0ae63dd524c3f2eba1.tar.bz2
cmMakefile: Simplify programmer error to an assert
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx11
1 files changed, 3 insertions, 8 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 47d9b47..6ab45bb 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1832,14 +1832,9 @@ cmTarget* cmMakefile::AddLibrary(const std::string& lname,
const std::vector<std::string>& srcs,
bool excludeFromAll)
{
- // wrong type ? default to STATIC
- if ((type != cmState::STATIC_LIBRARY) && (type != cmState::SHARED_LIBRARY) &&
- (type != cmState::MODULE_LIBRARY) && (type != cmState::OBJECT_LIBRARY) &&
- (type != cmState::INTERFACE_LIBRARY)) {
- this->IssueMessage(cmake::INTERNAL_ERROR,
- "cmMakefile::AddLibrary given invalid target type.");
- type = cmState::STATIC_LIBRARY;
- }
+ assert(type == cmState::STATIC_LIBRARY || type == cmState::SHARED_LIBRARY ||
+ type == cmState::MODULE_LIBRARY || type == cmState::OBJECT_LIBRARY ||
+ type == cmState::INTERFACE_LIBRARY);
cmTarget* target = this->AddNewTarget(type, lname);
// Clear its dependencies. Otherwise, dependencies might persist