diff options
author | Ken Martin <ken.martin@kitware.com> | 2005-06-08 20:39:29 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2005-06-08 20:39:29 (GMT) |
commit | cc6170c4946a30106676e5718066316148deec04 (patch) | |
tree | 587351a8958afad206bf269785eab7b7ca757406 /Source/cmAddLibraryCommand.cxx | |
parent | 4ff9d1eae3945590fdc8e7ca6539b856418e5684 (diff) | |
download | CMake-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/cmAddLibraryCommand.cxx')
-rw-r--r-- | Source/cmAddLibraryCommand.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index cb7c2d7..9af872c 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -26,7 +26,8 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args) } // Library type defaults to value of BUILD_SHARED_LIBS, if it exists, // otherwise it defaults to static library. - int shared = !cmSystemTools::IsOff(m_Makefile->GetDefinition("BUILD_SHARED_LIBS")); + int shared = + !cmSystemTools::IsOff(m_Makefile->GetDefinition("BUILD_SHARED_LIBS")); std::vector<std::string>::const_iterator s = args.begin(); @@ -57,6 +58,12 @@ bool cmAddLibraryCommand::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; while (s != args.end()) { |