[Cmake-commits] [cmake-commits] king committed cmLocalUnixMakefileGenerator3.cxx 1.238 1.239
cmake-commits at cmake.org
cmake-commits at cmake.org
Tue Mar 11 17:53:56 EDT 2008
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv29370/Source
Modified Files:
cmLocalUnixMakefileGenerator3.cxx
Log Message:
BUG: Fix subtle bug that prevented Makefile generators from rescanning dependencies when a new source file is added but no other sources are touched.
Index: cmLocalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.cxx,v
retrieving revision 1.238
retrieving revision 1.239
diff -C 2 -d -r1.238 -r1.239
*** cmLocalUnixMakefileGenerator3.cxx 18 Feb 2008 21:38:34 -0000 1.238
--- cmLocalUnixMakefileGenerator3.cxx 11 Mar 2008 21:53:54 -0000 1.239
***************
*** 25,28 ****
--- 25,29 ----
#include "cmake.h"
#include "cmVersion.h"
+ #include "cmFileTimeComparison.h"
// Include dependency scanners for supported languages. Only the
***************
*** 1308,1311 ****
--- 1309,1336 ----
std::string dependFile = dir + "/depend.make";
+ // If the target DependInfo.cmake file has changed since the last
+ // time dependencies were scanned then force rescanning. This may
+ // happen when a new source file is added and CMake regenerates the
+ // project but no other sources were touched.
+ bool needRescan = false;
+ cmFileTimeComparison* ftc =
+ this->GlobalGenerator->GetCMakeInstance()->GetFileComparison();
+ {
+ int result;
+ if(!ftc->FileTimeCompare(internalDependFile.c_str(), tgtInfo, &result) ||
+ result < 0)
+ {
+ if(verbose)
+ {
+ cmOStringStream msg;
+ msg << "Dependee \"" << tgtInfo
+ << "\" is newer than depender \""
+ << internalDependFile << "\"." << std::endl;
+ cmSystemTools::Stdout(msg.str().c_str());
+ }
+ needRescan = true;
+ }
+ }
+
// Check the implicit dependencies to see if they are up to date.
// The build.make file may have explicit dependencies for the object
***************
*** 1314,1320 ****
cmDependsC checker;
checker.SetVerbose(verbose);
! checker.SetFileComparison
! (this->GlobalGenerator->GetCMakeInstance()->GetFileComparison());
! if(!checker.Check(dependFile.c_str(), internalDependFile.c_str()))
{
// The dependencies must be regenerated.
--- 1339,1345 ----
cmDependsC checker;
checker.SetVerbose(verbose);
! checker.SetFileComparison(ftc);
! if(needRescan ||
! !checker.Check(dependFile.c_str(), internalDependFile.c_str()))
{
// The dependencies must be regenerated.
More information about the Cmake-commits
mailing list