summaryrefslogtreecommitdiffstats
path: root/Source/cmDepends.cxx
diff options
context:
space:
mode:
authorMichael Wild <themiwi@users.sourceforge.net>2009-12-14 17:06:51 (GMT)
committerBrad King <brad.king@kitware.com>2012-11-06 16:54:39 (GMT)
commitc66f03adf93fc402141ed5dc17d39bae1af3bbfd (patch)
tree468fcbf6cf056c4c599108b33697f8af5e59d2d8 /Source/cmDepends.cxx
parente74ff7c29fc764af63ed3f5195ecc64730c07939 (diff)
downloadCMake-c66f03adf93fc402141ed5dc17d39bae1af3bbfd.zip
CMake-c66f03adf93fc402141ed5dc17d39bae1af3bbfd.tar.gz
CMake-c66f03adf93fc402141ed5dc17d39bae1af3bbfd.tar.bz2
cmDepends: No dependency-vector erasure in CheckDependencies
Some dependency-generators (such as cmDependsFortran) generate multiple entries per depender, so erasing the dependency vector for each depender found loses earlier dependencies. Signed-off-by: Michael Wild <themiwi@users.sourceforge.net>
Diffstat (limited to 'Source/cmDepends.cxx')
-rw-r--r--Source/cmDepends.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx
index ebe8a68..74a0ccb 100644
--- a/Source/cmDepends.cxx
+++ b/Source/cmDepends.cxx
@@ -181,8 +181,10 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends,
// kdelibs/khtml this reduces the number of calls from 184k down to 92k,
// or the time for cmake -E cmake_depends from 0.3 s down to 0.21 s.
dependerExists = cmSystemTools::FileExists(this->Depender);
- DependencyVector tmp;
- validDeps[this->Depender] = tmp;
+ // If we erase validDeps[this->Depender] by overwriting it with an empty
+ // vector, we lose dependencies for dependers that have multiple
+ // entries. No need to initialize the entry, std::map will do so on first
+ // access.
currentDependencies = &validDeps[this->Depender];
continue;
}