summaryrefslogtreecommitdiffstats
path: root/Source/cmAddExecutableCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2005-06-08 20:39:29 (GMT)
committerKen Martin <ken.martin@kitware.com>2005-06-08 20:39:29 (GMT)
commitcc6170c4946a30106676e5718066316148deec04 (patch)
tree587351a8958afad206bf269785eab7b7ca757406 /Source/cmAddExecutableCommand.cxx
parent4ff9d1eae3945590fdc8e7ca6539b856418e5684 (diff)
downloadCMake-cc6170c4946a30106676e5718066316148deec04.zip
CMake-cc6170c4946a30106676e5718066316148deec04.tar.gz
CMake-cc6170c4946a30106676e5718066316148deec04.tar.bz2
ENH: better error checking for add library or executable with no source files
Diffstat (limited to 'Source/cmAddExecutableCommand.cxx')
-rw-r--r--Source/cmAddExecutableCommand.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx
index 0bc2a7a..f70e790 100644
--- a/Source/cmAddExecutableCommand.cxx
+++ b/Source/cmAddExecutableCommand.cxx
@@ -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 )