summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmLinkLibrariesCommand.cxx10
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx10
2 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmLinkLibrariesCommand.cxx b/Source/cmLinkLibrariesCommand.cxx
index 56d4937..c34cd3c 100644
--- a/Source/cmLinkLibrariesCommand.cxx
+++ b/Source/cmLinkLibrariesCommand.cxx
@@ -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);
}
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 1237fac..b917781 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -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);
}