BUG: Fixed crash when optimized/debug argument is not followed by a value.
This commit is contained in:
parent
8e13e2de90
commit
e3edb83c51
|
@ -31,12 +31,22 @@ bool cmLinkLibrariesCommand::InitialPass(std::vector<std::string> const& args)
|
|||
if (*i == "debug")
|
||||
{
|
||||
++i;
|
||||
if(i == args.end())
|
||||
{
|
||||
this->SetError("The \"debug\" argument must be followed by a library");
|
||||
return false;
|
||||
}
|
||||
m_Makefile->AddLinkLibrary(i->c_str(),
|
||||
cmTarget::DEBUG);
|
||||
}
|
||||
else if (*i == "optimized")
|
||||
{
|
||||
++i;
|
||||
if(i == args.end())
|
||||
{
|
||||
this->SetError("The \"optimized\" argument must be followed by a library");
|
||||
return false;
|
||||
}
|
||||
m_Makefile->AddLinkLibrary(i->c_str(),
|
||||
cmTarget::OPTIMIZED);
|
||||
}
|
||||
|
|
|
@ -42,12 +42,22 @@ bool cmTargetLinkLibrariesCommand::InitialPass(std::vector<std::string> const& a
|
|||
if (*i == "debug")
|
||||
{
|
||||
++i;
|
||||
if(i == args.end())
|
||||
{
|
||||
this->SetError("The \"debug\" argument must be followed by a library");
|
||||
return false;
|
||||
}
|
||||
m_Makefile->AddLinkLibraryForTarget(args[0].c_str(),i->c_str(),
|
||||
cmTarget::DEBUG);
|
||||
}
|
||||
else if (*i == "optimized")
|
||||
{
|
||||
++i;
|
||||
if(i == args.end())
|
||||
{
|
||||
this->SetError("The \"optimized\" argument must be followed by a library");
|
||||
return false;
|
||||
}
|
||||
m_Makefile->AddLinkLibraryForTarget(args[0].c_str(),i->c_str(),
|
||||
cmTarget::OPTIMIZED);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue