From c24c2cca18c9bdf03de7e165259e3b87251ef1fe Mon Sep 17 00:00:00 2001 From: Amitha Perera Date: Wed, 29 May 2002 15:00:37 -0400 Subject: [PATCH] BUG: never make a target depend on itself. This was causing unnecessary library duplication, resulting in link errors on some platforms. --- Source/cmTarget.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 121f308cf..04c9a4cc0 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -104,6 +104,12 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, const char *target, const char* lib, 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(lib,llt) ); if(llt != cmTarget::GENERAL)