From f528e6bcb9b2e181dcd7ee0c1cc327b6cad84ad5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 21 Oct 2015 19:51:50 +0200 Subject: Makefiles: Port progress marks to cmGeneratorTarget. --- Source/cmGeneratorTarget.cxx | 12 ++++++++++++ Source/cmGeneratorTarget.h | 5 +++++ Source/cmGlobalUnixMakefileGenerator3.cxx | 6 +++--- Source/cmGlobalUnixMakefileGenerator3.h | 4 ++-- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 3f600b2..fe6b446 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3607,6 +3607,18 @@ std::string cmGeneratorTarget::GetPDBName(const std::string& config) const return prefix+base+".pdb"; } +bool cmGeneratorTarget::StrictTargetComparison::operator()( + cmGeneratorTarget const* t1, cmGeneratorTarget const* t2) const +{ + int nameResult = strcmp(t1->GetName().c_str(), t2->GetName().c_str()); + if (nameResult == 0) + { + return strcmp(t1->GetLocalGenerator()->GetCurrentBinaryDirectory(), + t2->GetLocalGenerator()->GetCurrentBinaryDirectory()) < 0; + } + return nameResult < 0; +} + //---------------------------------------------------------------------------- struct cmGeneratorTarget::SourceFileFlags cmGeneratorTarget::GetTargetSourceFileFlags(const cmSourceFile* sf) const diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 4383288..544cf0e 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -673,6 +673,11 @@ public: { return this->MaxLanguageStandards; } + + struct StrictTargetComparison { + bool operator()(cmGeneratorTarget const* t1, + cmGeneratorTarget const* t2) const; + }; }; #endif diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 74d23a3..248701a 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -778,7 +778,7 @@ cmGlobalUnixMakefileGenerator3 std::ostringstream progressArg; const char* sep = ""; std::vector& progFiles = - this->ProgressMap[gtarget->Target].Marks; + this->ProgressMap[gtarget].Marks; for (std::vector::iterator i = progFiles.begin(); i != progFiles.end(); ++i) { @@ -966,7 +966,7 @@ cmGlobalUnixMakefileGenerator3 size_t count = 0; if(emitted.insert(target).second) { - count = this->ProgressMap[target->Target].Marks.size(); + count = this->ProgressMap[target].Marks.size(); TargetDependSet const& depends = this->GetTargetDirectDepends(target); for(TargetDependSet::const_iterator di = depends.begin(); di != depends.end(); ++di) @@ -1003,7 +1003,7 @@ void cmGlobalUnixMakefileGenerator3::RecordTargetProgress( cmMakefileTargetGenerator* tg) { - TargetProgress& tp = this->ProgressMap[tg->GetTarget()]; + TargetProgress& tp = this->ProgressMap[tg->GetGeneratorTarget()]; tp.NumberOfActions = tg->GetNumberOfProgressActions(); tp.VariableFile = tg->GetProgressFileNameFull(); } diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 5f39c79..0485eb8 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -192,8 +192,8 @@ protected: std::vector Marks; void WriteProgressVariables(unsigned long total, unsigned long& current); }; - typedef std::map ProgressMapType; + typedef std::map ProgressMapType; ProgressMapType ProgressMap; size_t CountProgressMarksInTarget(cmGeneratorTarget const* target, -- cgit v0.12