summaryrefslogtreecommitdiffstats
path: root/Source/cmDepends.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-12-19 21:36:30 (GMT)
committerBrad King <brad.king@kitware.com>2007-12-19 21:36:30 (GMT)
commitde96fd1df995f5b7d3f79514a5a3bf90c6b4b205 (patch)
tree381cb2630c9854fb72f0580b910789dc62882a7b /Source/cmDepends.cxx
parentc7bf320539c12de919b34868a6af558459f2ddc0 (diff)
downloadCMake-de96fd1df995f5b7d3f79514a5a3bf90c6b4b205.zip
CMake-de96fd1df995f5b7d3f79514a5a3bf90c6b4b205.tar.gz
CMake-de96fd1df995f5b7d3f79514a5a3bf90c6b4b205.tar.bz2
ENH: Moved dependency integrity check from CheckBuildSystem over to a per-target UpdateDependencies step. This greatly reduces the startup time for make processes and allows individual targets to be built without a global dependency check.
Diffstat (limited to 'Source/cmDepends.cxx')
-rw-r--r--Source/cmDepends.cxx22
1 files changed, 14 insertions, 8 deletions
diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx
index 37c177b..93beee6 100644
--- a/Source/cmDepends.cxx
+++ b/Source/cmDepends.cxx
@@ -48,7 +48,7 @@ bool cmDepends::Write(const char *src, const char *obj,
}
//----------------------------------------------------------------------------
-void cmDepends::Check(const char *makeFile, const char *internalFile)
+bool cmDepends::Check(const char *makeFile, const char *internalFile)
{
// Dependency checks must be done in proper working directory.
std::string oldcwd = ".";
@@ -61,12 +61,14 @@ void 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)))
{
// Clear all dependencies so they will be regenerated.
this->Clear(makeFile);
- this->Clear(internalFile);
+ cmSystemTools::RemoveFile(internalFile);
+ okay = false;
}
// Restore working directory.
@@ -74,6 +76,8 @@ void cmDepends::Check(const char *makeFile, const char *internalFile)
{
cmSystemTools::ChangeDirectory(oldcwd.c_str());
}
+
+ return okay;
}
//----------------------------------------------------------------------------
@@ -87,12 +91,6 @@ void cmDepends::Clear(const char *file)
cmSystemTools::Stdout(msg.str().c_str());
}
- // Remove the dependency mark file to be sure dependencies will be
- // regenerated.
- std::string markFile = file;
- markFile += ".mark";
- cmSystemTools::RemoveFile(markFile.c_str());
-
// Write an empty dependency file.
cmGeneratedFileStream depFileStream(file);
depFileStream
@@ -101,6 +99,14 @@ void cmDepends::Clear(const char *file)
}
//----------------------------------------------------------------------------
+bool cmDepends::WriteDependencies(const char*, const char*,
+ std::ostream&, std::ostream&)
+{
+ // This should be implemented by the subclass.
+ return false;
+}
+
+//----------------------------------------------------------------------------
bool cmDepends::CheckDependencies(std::istream& internalDepends)
{
// Parse dependencies from the stream. If any dependee is missing