summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-06-02 20:44:58 (GMT)
committerBrad King <brad.king@kitware.com>2008-06-02 20:44:58 (GMT)
commit6be09c366774ed6d723a06f5f07ba5c09d8e4579 (patch)
tree55aef0c5ad0c7b582b76494f5db1b5e291c2e76a /Source/cmGlobalGenerator.h
parentdb59f49ecf6767e66d9edd12194bcd60804dc8a3 (diff)
downloadCMake-6be09c366774ed6d723a06f5f07ba5c09d8e4579.zip
CMake-6be09c366774ed6d723a06f5f07ba5c09d8e4579.tar.gz
CMake-6be09c366774ed6d723a06f5f07ba5c09d8e4579.tar.bz2
ENH: Introduce "rule hashes" to help rebuild files when rules change.
- In CMake 2.4 custom commands would not rebuild when rules changed. - In CMake 2.6.0 custom commands have a dependency on build.make which causes them to rebuild when changed, but also when any source is added or removed. This is too often. - We cannot have a per-rule file because Windows filesystems do not deal well with lots of small files. - Instead we add a persistent CMakeFiles/CMakeRuleHashes.txt file at the top of the build tree that is updated during each CMake Generate step. It records a hash of the build rule for each file to be built. When the hash changes the file is removed so that it will be rebuilt.
Diffstat (limited to 'Source/cmGlobalGenerator.h')
-rw-r--r--Source/cmGlobalGenerator.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 519158f..ae9a46d 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -245,6 +245,10 @@ public:
void FileReplacedDuringGenerate(const std::string& filename);
void GetFilesReplacedDuringGenerate(std::vector<std::string>& filenames);
+ void AddRuleHash(const std::vector<std::string>& outputs,
+ const std::vector<std::string>& depends,
+ const std::vector<std::string>& commands);
+
protected:
// for a project collect all its targets by following depend
// information, and also collect all the targets
@@ -313,6 +317,11 @@ private:
// this is used to improve performance
std::map<cmStdString,cmTarget *> TotalTargets;
+ // Record hashes for rules and outputs.
+ struct RuleHash { char Data[32]; };
+ std::map<cmStdString, RuleHash> RuleHashes;
+ void CheckRuleHashes();
+
cmExternalMakefileProjectGenerator* ExtraGenerator;
// track files replaced during a Generate