ENH: better error checking for add library or executable with no source files

This commit is contained in:
Ken Martin
2005-06-08 16:39:29 -04:00
parent 4ff9d1eae3
commit cc6170c494
2 changed files with 14 additions and 1 deletions
+6
View File
@@ -49,6 +49,12 @@ bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args)
}
}
if (s == args.end())
{
this->SetError("called with incorrect number of arguments, no sources provided");
return false;
}
std::vector<std::string> srclists(s, args.end());
cmTarget* tgt = m_Makefile->AddExecutable(exename.c_str(), srclists);
if ( use_win32 )