ENH: Added error reporting for missing arguments to ENDIF.
This commit is contained in:
parent
73fd2381b9
commit
aa49d94ce0
|
@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
bool cmIfFunctionBlocker::
|
||||
IsFunctionBlocked(const char *name, const std::vector<std::string> &args,
|
||||
cmMakefile &)
|
||||
cmMakefile &mf)
|
||||
{
|
||||
if (!strcmp(name,"ELSE") || !strcmp(name,"ENDIF"))
|
||||
{
|
||||
|
@ -51,6 +51,22 @@ IsFunctionBlocked(const char *name, const std::vector<std::string> &args,
|
|||
{
|
||||
return false;
|
||||
}
|
||||
else if(args.empty())
|
||||
{
|
||||
std::string err = "Empty arguments for ";
|
||||
err += name;
|
||||
err += ". Did you mean ";
|
||||
err += name;
|
||||
err += "( ";
|
||||
for(std::vector<std::string>::const_iterator a = m_Args.begin();
|
||||
a != m_Args.end();++a)
|
||||
{
|
||||
err += *a;
|
||||
err += " ";
|
||||
}
|
||||
err += ")?";
|
||||
cmSystemTools::Error(err.c_str());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue