summaryrefslogtreecommitdiff
path: root/Source/cmUnixMakefileGenerator.cxx
diff options
context:
space:
mode:
authorAmitha Perera <perera@cs.rpi.edu>2001-05-29 14:16:27 -0400
committerAmitha Perera <perera@cs.rpi.edu>2001-05-29 14:16:27 -0400
commitdbf65f216fd08ce12df51bae17d0382473ce1d7b (patch)
tree61f5e57464dd1d0e049ca856e61cc9f0cfe1f361 /Source/cmUnixMakefileGenerator.cxx
parentbdfdfb73a2b2a4eec7763a50237aeb7cdf11f515 (diff)
downloadcmake-dbf65f216fd08ce12df51bae17d0382473ce1d7b.tar.gz
BUG: Now only one makefile rule is generated per depenency. This eliminates
a number of warnings.
Diffstat (limited to 'Source/cmUnixMakefileGenerator.cxx')
-rw-r--r--Source/cmUnixMakefileGenerator.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx
index 4be093ac39..73de1a4448 100644
--- a/Source/cmUnixMakefileGenerator.cxx
+++ b/Source/cmUnixMakefileGenerator.cxx
@@ -370,16 +370,23 @@ void cmUnixMakefileGenerator::OutputTargets(std::ostream& fout)
// in this makefile will depend on.
void cmUnixMakefileGenerator::OutputDependencies(std::ostream& fout)
{
+ // Each dependency should only be emitted once.
+ std::set<std::string> emitted;
+
fout << "CMAKE_DEPEND_LIBS = ";
cmTarget::LinkLibraries& libs = m_Makefile->GetLinkLibraries();
cmTarget::LinkLibraries::const_iterator lib2;
+
// Search the list of libraries that will be linked into
// the executable
+ emitted.clear();
for(lib2 = libs.begin(); lib2 != libs.end(); ++lib2)
{
// loop over the list of directories that the libraries might
// be in, looking for an ADD_LIBRARY(lib...) line. This would
// be stored in the cache
+ if( ! emitted.insert(lib2->first).second ) continue;
+
const char* cacheValue
= cmCacheManager::GetInstance()->GetCacheValue(lib2->first.c_str());
if(cacheValue)
@@ -400,11 +407,15 @@ void cmUnixMakefileGenerator::OutputDependencies(std::ostream& fout)
}
}
fout << "\n\n";
+
+ emitted.clear();
for(lib2 = libs.begin(); lib2 != libs.end(); ++lib2)
{
// loop over the list of directories that the libraries might
// be in, looking for an ADD_LIBRARY(lib...) line. This would
// be stored in the cache
+ if( ! emitted.insert(lib2->first).second ) continue;
+
const char* cacheValue
= cmCacheManager::GetInstance()->GetCacheValue(lib2->first.c_str());
if(cacheValue)