This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via f9c04e2f1738d06b4a23549b32f5a7a6e708abcc (commit) via 87fe4286bdb3f4faffbc603697b4a6f3343fb4ec (commit) from f8133bf98febcd02690548edfbe476aaabdd0623 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f9c04e2f1738d06b4a23549b32f5a7a6e708abcc commit f9c04e2f1738d06b4a23549b32f5a7a6e708abcc Merge: f8133bf 87fe428 Author: Alexander Neundorf <neund...@kde.org> AuthorDate: Fri Aug 17 16:41:42 2012 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Fri Aug 17 16:41:42 2012 -0400 Merge topic 'DependencyScanning_13474' into next 87fe428 fix #13474: also rescan dependencies if the depender does not exist http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=87fe4286bdb3f4faffbc603697b4a6f3343fb4ec commit 87fe4286bdb3f4faffbc603697b4a6f3343fb4ec Author: Alex Neundorf <neund...@kde.org> AuthorDate: Thu Aug 16 22:46:33 2012 +0200 Commit: Alex Neundorf <neund...@kde.org> CommitDate: Fri Aug 17 22:38:38 2012 +0200 fix #13474: also rescan dependencies if the depender does not exist If the depender (e.g. foo.o) does not exist, also rescan dependencies if one of the dependees (e.g. foo.cxx) is older than the already existing depend.internal file, since this means it can be out of date. Alex diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx index 545fe97..5a48f7f 100644 --- a/Source/cmDepends.cxx +++ b/Source/cmDepends.cxx @@ -98,7 +98,7 @@ bool cmDepends::Check(const char *makeFile, const char *internalFile, // Check whether dependencies must be regenerated. bool okay = true; std::ifstream fin(internalFile); - if(!(fin && this->CheckDependencies(fin, validDeps))) + if(!(fin && this->CheckDependencies(fin, internalFile, validDeps))) { // Clear all dependencies so they will be regenerated. this->Clear(makeFile); @@ -143,6 +143,7 @@ bool cmDepends::WriteDependencies(const char*, const char*, //---------------------------------------------------------------------------- bool cmDepends::CheckDependencies(std::istream& internalDepends, + const char* internalDependsFileName, std::map<std::string, DependencyVector>& validDeps) { // Parse dependencies from the stream. If any dependee is missing @@ -186,8 +187,11 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends, } */ - // Dependencies must be regenerated if the dependee does not exist - // or if the depender exists and is older than the dependee. + // Dependencies must be regenerated + // * if the dependee does not exist + // * if the depender exists and is older than the dependee. + // * if the depender does not exist, but the dependee is newer than the + // depends file bool regenerate = false; const char* dependee = this->Dependee+1; const char* depender = this->Depender; @@ -211,24 +215,49 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends, cmSystemTools::Stdout(msg.str().c_str()); } } - else if(dependerExists) + else { - // The dependee and depender both exist. Compare file times. - int result = 0; - if((!this->FileComparison->FileTimeCompare(depender, dependee, - &result) || result < 0)) + if(dependerExists) { - // The depender is older than the dependee. - regenerate = true; + // The dependee and depender both exist. Compare file times. + int result = 0; + if((!this->FileComparison->FileTimeCompare(depender, dependee, + &result) || result < 0)) + { + // The depender is older than the dependee. + regenerate = true; - // Print verbose output. - if(this->Verbose) + // Print verbose output. + if(this->Verbose) + { + cmOStringStream msg; + msg << "Dependee \"" << dependee + << "\" is newer than depender \"" + << depender << "\"." << std::endl; + cmSystemTools::Stdout(msg.str().c_str()); + } + } + } + else + { + // The dependee exists, but the depender doesn't. Regenerate if the + // internalDepends file is older than the dependee. + int result = 0; + if((!this->FileComparison->FileTimeCompare(internalDependsFileName, dependee, + &result) || result < 0)) { - cmOStringStream msg; - msg << "Dependee \"" << dependee - << "\" is newer than depender \"" - << depender << "\"." << std::endl; - cmSystemTools::Stdout(msg.str().c_str()); + // The depends-file is older than the dependee. + regenerate = true; + + // Print verbose output. + if(this->Verbose) + { + cmOStringStream msg; + msg << "Dependee \"" << dependee + << "\" is newer than depends file \"" + << internalDependsFileName << "\"." << std::endl; + cmSystemTools::Stdout(msg.str().c_str()); + } } } } diff --git a/Source/cmDepends.h b/Source/cmDepends.h index 100e187..f7dc881 100644 --- a/Source/cmDepends.h +++ b/Source/cmDepends.h @@ -83,6 +83,7 @@ protected: // Return false if dependencies must be regenerated and true // otherwise. virtual bool CheckDependencies(std::istream& internalDepends, + const char* internalDependsFileName, std::map<std::string, DependencyVector>& validDeps); // Finalize the dependency information for the target. ----------------------------------------------------------------------- Summary of changes: Source/cmDepends.cxx | 63 ++++++++++++++++++++++++++++++++++++------------- Source/cmDepends.h | 1 + 2 files changed, 47 insertions(+), 17 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits