BUG: never make a target depend on itself. This was causing unnecessary library duplication, resulting in link errors on some platforms.

This commit is contained in:
Amitha Perera 2002-05-29 15:00:37 -04:00
parent 8f60b06037
commit c24c2cca18
1 changed files with 6 additions and 0 deletions

View File

@ -104,6 +104,12 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
const char *target, const char* lib, const char *target, const char* lib,
LinkLibraryType llt) LinkLibraryType llt)
{ {
// Never add a self dependency, even if the user asks for it.
if(strcmp( target, lib ) == 0)
{
return;
}
m_LinkLibraries.push_back( std::pair<std::string, cmTarget::LinkLibraryType>(lib,llt) ); m_LinkLibraries.push_back( std::pair<std::string, cmTarget::LinkLibraryType>(lib,llt) );
if(llt != cmTarget::GENERAL) if(llt != cmTarget::GENERAL)