summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-02-02 18:28:12 (GMT)
committerBrad King <brad.king@kitware.com>2009-02-02 18:28:12 (GMT)
commitac9b7ec1558e1370f578c67b1296fbe778a92b81 (patch)
tree8fe4990c6e318e0bdbf136dcf805e817c024440d /Source/cmMakefileTargetGenerator.cxx
parent7d6a5e097f17720ed21fe5faac1759bf387c7880 (diff)
downloadCMake-ac9b7ec1558e1370f578c67b1296fbe778a92b81.zip
CMake-ac9b7ec1558e1370f578c67b1296fbe778a92b81.tar.gz
CMake-ac9b7ec1558e1370f578c67b1296fbe778a92b81.tar.bz2
ENH: Refactor custom command rule hashing
This simplifies computation of custom command rule hashes to hash content exactly chosen as the custom commands are generated. Unfortunately this will change the hashes of existing build trees from earlier CMake versions, but this is not a big deal. The change is necessary so that in the future we can make optional adjustments to custom command lines at generate time without changing the hashes every time the option is changed.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index e19cd1d..c2cad66 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1119,11 +1119,12 @@ void cmMakefileTargetGenerator
->AppendEcho(commands, comment.c_str(),
cmLocalUnixMakefileGenerator3::EchoGenerate);
}
- // Below we need to skip over the echo and progress commands.
- unsigned int skip = static_cast<unsigned int>(commands.size());
// Now append the actual user-specified commands.
- this->LocalGenerator->AppendCustomCommand(commands, cc);
+ cmOStringStream content;
+ this->LocalGenerator->AppendCustomCommand(commands, cc, false,
+ cmLocalGenerator::HOME_OUTPUT,
+ &content);
// Collect the dependencies.
std::vector<std::string> depends;
@@ -1151,9 +1152,7 @@ void cmMakefileTargetGenerator
// If the rule has changed make sure the output is rebuilt.
if(!symbolic)
{
- this->GlobalGenerator->AddRuleHash(cc.GetOutputs(),
- commands.begin()+skip,
- commands.end());
+ this->GlobalGenerator->AddRuleHash(cc.GetOutputs(), content.str());
}
}