diff options
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 15 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 3 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 11 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.h | 3 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 11 |
5 files changed, 23 insertions, 20 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index be9b0df..b0a6e83 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2004,8 +2004,7 @@ cmGlobalGenerator::GetDirectoryContent(std::string const& dir, bool needDisk) //---------------------------------------------------------------------------- void cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs, - std::vector<std::string>::const_iterator first, - std::vector<std::string>::const_iterator last) + std::string const& content) { #if defined(CMAKE_BUILD_WITH_CMAKE) // Ignore if there are no outputs. @@ -2017,16 +2016,12 @@ cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs, // Compute a hash of the rule. RuleHash hash; { - unsigned char const* data; - int length; + unsigned char const* data = + reinterpret_cast<unsigned char const*>(content.c_str()); + int length = static_cast<int>(content.length()); cmsysMD5* sum = cmsysMD5_New(); cmsysMD5_Initialize(sum); - for(std::vector<std::string>::const_iterator i = first; i != last; ++i) - { - data = reinterpret_cast<unsigned char const*>(i->c_str()); - length = static_cast<int>(i->length()); - cmsysMD5_Append(sum, data, length); - } + cmsysMD5_Append(sum, data, length); cmsysMD5_FinalizeHex(sum, hash.Data); cmsysMD5_Delete(sum); } diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 51e462d..60847c2 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -251,8 +251,7 @@ public: void GetFilesReplacedDuringGenerate(std::vector<std::string>& filenames); void AddRuleHash(const std::vector<std::string>& outputs, - std::vector<std::string>::const_iterator first, - std::vector<std::string>::const_iterator last); + std::string const& content); protected: // for a project collect all its targets by following depend diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 9517cd8..fad722d 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -968,7 +968,8 @@ void cmLocalUnixMakefileGenerator3 ::AppendCustomCommand(std::vector<std::string>& commands, const cmCustomCommand& cc, bool echo_comment, - cmLocalGenerator::RelativeRoot relative) + cmLocalGenerator::RelativeRoot relative, + std::ostream* content) { // Optionally create a command to display the custom command's // comment text. This is used for pre-build, pre-link, and @@ -991,6 +992,10 @@ cmLocalUnixMakefileGenerator3 { dir = workingDir; } + if(content) + { + *content << dir; + } bool escapeOldStyle = cc.GetEscapeOldStyle(); bool escapeAllowMakeVars = cc.GetEscapeAllowMakeVars(); @@ -1048,6 +1053,10 @@ cmLocalUnixMakefileGenerator3 escapeAllowMakeVars); } } + if(content) + { + *content << cmd; + } if(this->BorlandMakeCurlyHack) { // Borland Make has a very strange bug. If the first curly diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index ebb7c79..b35bdbc 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -332,7 +332,8 @@ protected: const cmCustomCommand& cc, bool echo_comment=false, cmLocalGenerator::RelativeRoot relative = - cmLocalGenerator::HOME_OUTPUT); + cmLocalGenerator::HOME_OUTPUT, + std::ostream* content = 0); void AppendCleanCommand(std::vector<std::string>& commands, const std::vector<std::string>& files, cmTarget& target, const char* filename =0); 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()); } } |