diff options
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 30 | ||||
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.h | 3 |
2 files changed, 22 insertions, 11 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index a647a9c..d955183 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -823,8 +823,10 @@ cmGlobalUnixMakefileGenerator3 cmLocalGenerator::FULL, cmLocalGenerator::SHELL); // + std::set<cmStdString> emitted; progCmd << " " - << this->GetTargetTotalNumberOfActions(t->second); + << this->GetTargetTotalNumberOfActions(t->second, + emitted); commands.push_back(progCmd.str()); } std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash(); @@ -895,18 +897,26 @@ cmGlobalUnixMakefileGenerator3 //---------------------------------------------------------------------------- int cmGlobalUnixMakefileGenerator3 -::GetTargetTotalNumberOfActions(cmTarget& target) +::GetTargetTotalNumberOfActions(cmTarget& target, + std::set<cmStdString> &emitted) { - cmLocalUnixMakefileGenerator3 *lg = - static_cast<cmLocalUnixMakefileGenerator3 *> - (target.GetMakefile()->GetLocalGenerator()); - int result = static_cast<int>(lg->ProgressFiles[target.GetName()].size()); - std::vector<cmTarget *>& depends = this->GetTargetDepends(target); + // do not double count + int result = 0; - std::vector<cmTarget *>::iterator i; - for (i = depends.begin(); i != depends.end(); ++i) + if(emitted.insert(target.GetName()).second) { - result += this->GetTargetTotalNumberOfActions(**i); + cmLocalUnixMakefileGenerator3 *lg = + static_cast<cmLocalUnixMakefileGenerator3 *> + (target.GetMakefile()->GetLocalGenerator()); + result = static_cast<int>(lg->ProgressFiles[target.GetName()].size()); + + std::vector<cmTarget *>& depends = this->GetTargetDepends(target); + + std::vector<cmTarget *>::iterator i; + for (i = depends.begin(); i != depends.end(); ++i) + { + result += this->GetTargetTotalNumberOfActions(**i, emitted); + } } return result; diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 9e78f7a..f074510 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -124,7 +124,8 @@ public: const char* config, bool ignoreErrors, bool fast); // returns some progress informaiton - int GetTargetTotalNumberOfActions(cmTarget& target); + int GetTargetTotalNumberOfActions(cmTarget& target, + std::set<cmStdString> &emitted); unsigned long GetNumberOfProgressActionsInAll (cmLocalUnixMakefileGenerator3 *lg); |