diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2001-08-28 22:28:31 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2001-08-28 22:28:31 (GMT) |
commit | 5edd7673e1c7182c748584839ab1dec9712150b3 (patch) | |
tree | b781cf2b2427d8e8b9d7da52774597e597487c50 /Source/cmMakefile.cxx | |
parent | 91f27f6fbc3b1cc2423b09864438f59057e6665f (diff) | |
download | CMake-5edd7673e1c7182c748584839ab1dec9712150b3.zip CMake-5edd7673e1c7182c748584839ab1dec9712150b3.tar.gz CMake-5edd7673e1c7182c748584839ab1dec9712150b3.tar.bz2 |
ENH: add caching for the input CMakeList.txt files, 2X speed up
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 89e8e5c..0f57e5e 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmCommands.h" #include "cmCacheManager.h" #include "cmFunctionBlocker.h" +#include "cmListFileCache.h" #include <stdio.h> // required for sprintf // default is not to be building executables @@ -324,24 +325,27 @@ bool cmMakefile::ReadListFile(const char* filename, const char* external) { filenametoread= external; } - - std::ifstream fin(filenametoread); - if(!fin) + + cmListFile* lf = + cmListFileCache::GetInstance()->GetFileCache(filenametoread); + if(!lf) { cmSystemTools::Error("error can not open file ", filenametoread); return false; } + // add this list file to the list of dependencies + m_ListFiles.push_back( filenametoread); std::string name; std::vector<std::string> arguments; - while ( fin ) + int numberFunctions = lf->m_Functions.size(); + for(int i =0; i < numberFunctions; ++i) { - // add this list file to the list of dependencies - m_ListFiles.push_back( filenametoread); - - if(cmSystemTools::ParseFunction(fin, name, arguments) && - !this->IsFunctionBlocked(name.c_str(),arguments)) + cmListFileFunction& curFunction = lf->m_Functions[i]; + if(!this->IsFunctionBlocked(curFunction.m_Name.c_str(), + curFunction.m_Arguments)) { - this->ExecuteCommand(name,arguments); + this->ExecuteCommand(curFunction.m_Name, + curFunction.m_Arguments); } } |