summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
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/cmMakefileTargetGenerator.cxx
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/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 5e724d4..ea0d9b8 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1122,13 +1122,6 @@ void cmMakefileTargetGenerator
std::vector<std::string> depends;
this->LocalGenerator->AppendCustomDepend(depends, cc);
- // Add a dependency on the rule file itself.
- if(!cc.GetSkipRuleDepends())
- {
- this->LocalGenerator->AppendRuleDepend(depends,
- this->BuildFileNameFull.c_str());
- }
-
// Check whether we need to bother checking for a symbolic output.
bool need_symbolic = this->GlobalGenerator->GetNeedSymbolicMark();
@@ -1147,6 +1140,12 @@ void cmMakefileTargetGenerator
this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
o->c_str(), depends, commands,
symbolic);
+
+ // If the rule has changed make sure the output is rebuilt.
+ if(!symbolic)
+ {
+ this->GlobalGenerator->AddRuleHash(cc.GetOutputs(), depends, commands);
+ }
}
// Write rules to drive building any outputs beyond the first.