diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-10-12 17:51:15 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-10-12 17:51:15 (GMT) |
commit | a51dfefe796c1c7108d92e79dc77607c8307ef4b (patch) | |
tree | 18f9de11905f9a57872b05160b2e02d8162228a8 | |
parent | 2dd035c9a9fc712078c333ec282a741e6627624b (diff) | |
download | CMake-a51dfefe796c1c7108d92e79dc77607c8307ef4b.zip CMake-a51dfefe796c1c7108d92e79dc77607c8307ef4b.tar.gz CMake-a51dfefe796c1c7108d92e79dc77607c8307ef4b.tar.bz2 |
ENH: Optimize performance by caching stat results
-rw-r--r-- | Source/cmake.cxx | 5 | ||||
-rw-r--r-- | Source/cmake.h | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index ad2a580..35f4ad2 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -21,6 +21,7 @@ #include "cmLocalGenerator.h" #include "cmCommands.h" #include "cmCommand.h" +#include "cmFileTimeComparison.h" #if defined(CMAKE_BUILD_WITH_CMAKE) # include "cmDependsFortran.h" // For -E cmake_copy_f90_mod callback. @@ -95,6 +96,7 @@ cmake::cmake() { m_DebugTryCompile = false; m_ClearBuildSystem = false; + m_FileComparison = new cmFileTimeComparison; #ifdef __APPLE__ struct rlimit rlp; @@ -157,6 +159,7 @@ cmake::~cmake() #ifdef CMAKE_BUILD_WITH_CMAKE delete m_VariableWatch; #endif + delete m_FileComparison; } void cmake::CleanupCommandsAndMacros() @@ -1739,7 +1742,7 @@ int cmake::CheckBuildSystem() out != outputs.end(); ++out) { int result = 0; - if(!cmSystemTools::FileTimeCompare(out->c_str(), dep->c_str(), &result) || + if(!m_FileComparison->FileTimeCompare(out->c_str(), dep->c_str(), &result) || result < 0) { return 1; diff --git a/Source/cmake.h b/Source/cmake.h index 730d297..47a62b4 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -48,6 +48,7 @@ class cmCacheManager; class cmMakefile; class cmCommand; class cmVariableWatch; +class cmFileTimeComparison; class cmake { @@ -262,6 +263,11 @@ class cmake */ int AddCMakePaths(const char *arg0); + /** + * Get the file comparison class + */ + cmFileTimeComparison* GetFileComparison() { return m_FileComparison; } + protected: typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)(); typedef std::map<cmStdString, CreateGeneratorFunctionType> RegisteredGeneratorsMap; @@ -313,6 +319,7 @@ private: std::string m_CheckBuildSystem; bool m_ClearBuildSystem; bool m_DebugTryCompile; + cmFileTimeComparison* m_FileComparison; void UpdateConversionPathTable(); }; |