summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetLinkLibrariesCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmTargetLinkLibrariesCommand.cxx')
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx10
1 files changed, 10 insertions, 0 deletions
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);
}