diff options
author | Brad King <brad.king@kitware.com> | 2010-02-12 13:00:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-02-12 13:00:53 (GMT) |
commit | 41a608a75d09701dfc02d52e700862c48e643b47 (patch) | |
tree | aa2190c5059b12358fff7e5aa8a454644b0f6782 /Source/cmGlobalGenerator.h | |
parent | 41273582a5391f10ae8cfb5132c7e6e403332f4a (diff) | |
download | CMake-41a608a75d09701dfc02d52e700862c48e643b47.zip CMake-41a608a75d09701dfc02d52e700862c48e643b47.tar.gz CMake-41a608a75d09701dfc02d52e700862c48e643b47.tar.bz2 |
Fix rule hash persistence file generation
We store custom command rule hashes in CMakeFiles/CMakeRuleHashes.txt
persistently across CMake runs. When the rule hash changes we delete
the custom command output file and write a new hash into the persistence
file.
This functionality was first added by the commit 'Introduce "rule
hashes" to help rebuild files when rules change.' (2008-06-02).
However, the implementation in cmGlobalGenerator::CheckRuleHashes kept
the file open for read when attempting to rewrite a new file. On
Windows filesystems this prevented the new version of the file from
being written! This caused the first set of rule hashes to be used
forever within a build tree, meaning that all custom commands whose
rules changed would be rebuilt every time CMake regenerated the build
tree.
In this commit we address the problem by splitting the read and write
operations into separate methods. This ensures that the input stream is
closed before the output stream opens the file.
Diffstat (limited to 'Source/cmGlobalGenerator.h')
-rw-r--r-- | Source/cmGlobalGenerator.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index b7b4324..878be11 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -335,6 +335,8 @@ private: struct RuleHash { char Data[32]; }; std::map<cmStdString, RuleHash> RuleHashes; void CheckRuleHashes(); + void CheckRuleHashes(std::string const& pfile, std::string const& home); + void WriteRuleHashes(std::string const& pfile); void WriteSummary(); void WriteSummary(cmTarget* target); |