Commit a1cfc4fe authored by Stephen Kelly's avatar Stephen Kelly
Browse files

cmMakefile: Simplify programmer error to an assert

parent 4079ba20
...@@ -1832,14 +1832,9 @@ cmTarget* cmMakefile::AddLibrary(const std::string& lname, ...@@ -1832,14 +1832,9 @@ cmTarget* cmMakefile::AddLibrary(const std::string& lname,
const std::vector<std::string>& srcs, const std::vector<std::string>& srcs,
bool excludeFromAll) bool excludeFromAll)
{ {
// wrong type ? default to STATIC assert(type == cmState::STATIC_LIBRARY || type == cmState::SHARED_LIBRARY ||
if ((type != cmState::STATIC_LIBRARY) && (type != cmState::SHARED_LIBRARY) && type == cmState::MODULE_LIBRARY || type == cmState::OBJECT_LIBRARY ||
(type != cmState::MODULE_LIBRARY) && (type != cmState::OBJECT_LIBRARY) && type == cmState::INTERFACE_LIBRARY);
(type != cmState::INTERFACE_LIBRARY)) {
this->IssueMessage(cmake::INTERNAL_ERROR,
"cmMakefile::AddLibrary given invalid target type.");
type = cmState::STATIC_LIBRARY;
}
cmTarget* target = this->AddNewTarget(type, lname); cmTarget* target = this->AddNewTarget(type, lname);
// Clear its dependencies. Otherwise, dependencies might persist // Clear its dependencies. Otherwise, dependencies might persist
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment