diff options
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 1cbd423e4c..bd26b5fca9 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2068,20 +2068,27 @@ void cmGlobalGenerator::CheckRuleHashes() std::string pfile = home; pfile += this->GetCMakeInstance()->GetCMakeFilesDirectory(); pfile += "/CMakeRuleHashes.txt"; + this->CheckRuleHashes(pfile, home); + this->WriteRuleHashes(pfile); +#endif +} +//---------------------------------------------------------------------------- +void cmGlobalGenerator::CheckRuleHashes(std::string const& pfile, + std::string const& home) +{ #if defined(_WIN32) || defined(__CYGWIN__) std::ifstream fin(pfile.c_str(), std::ios::in | std::ios::binary); #else std::ifstream fin(pfile.c_str(), std::ios::in); #endif - bool goodStream = true; if(!fin) { - goodStream = false; + return; } std::string line; std::string fname; - while(goodStream && cmSystemTools::GetLineFromStream(fin, line)) + while(cmSystemTools::GetLineFromStream(fin, line)) { // Line format is a 32-byte hex string followed by a space // followed by a file name (with no escaping). @@ -2127,7 +2134,11 @@ void cmGlobalGenerator::CheckRuleHashes() } } } +} +//---------------------------------------------------------------------------- +void cmGlobalGenerator::WriteRuleHashes(std::string const& pfile) +{ // Now generate a new persistence file with the current hashes. if(this->RuleHashes.empty()) { @@ -2144,7 +2155,6 @@ void cmGlobalGenerator::CheckRuleHashes() fout << " " << rhi->first << "\n"; } } -#endif } //---------------------------------------------------------------------------- |