summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-09-28 21:34:23 (GMT)
committerBrad King <brad.king@kitware.com>2009-09-28 21:34:23 (GMT)
commit0089f9cf8f0ff484b83b03d1fc11fbd2536d59b9 (patch)
treecb804e30c4ab3b3ccd0afde7fdd147a6db3e4d99 /Source/cmGlobalUnixMakefileGenerator3.cxx
parenta091e99cb9a126e6a2d0093a916450cf894be2f3 (diff)
downloadCMake-0089f9cf8f0ff484b83b03d1fc11fbd2536d59b9.zip
CMake-0089f9cf8f0ff484b83b03d1fc11fbd2536d59b9.tar.gz
CMake-0089f9cf8f0ff484b83b03d1fc11fbd2536d59b9.tar.bz2
Fix support for OLD behavior of policy CMP0002
The commit "Cleanup make progress rule generation code" introduced a map from target name to the progress.make file location. Policy CMP0002's OLD behavior allows duplicate target names in different directories, so only one ends up with a progress.make file. This commit fixes the map to order by target name first and build directory second, restoring support for duplicate target names.
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx21
1 files changed, 18 insertions, 3 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index dd1e38e..9b3c5d5 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -750,7 +750,7 @@ cmGlobalUnixMakefileGenerator3
cmLocalGenerator::FULL,
cmLocalGenerator::SHELL);
progCmd << " ";
- std::vector<int> &progFiles = this->ProgressMap[t->first].Marks;
+ std::vector<int> &progFiles = this->ProgressMap[&t->second].Marks;
for (std::vector<int>::iterator i = progFiles.begin();
i != progFiles.end(); ++i)
{
@@ -873,7 +873,7 @@ cmGlobalUnixMakefileGenerator3
size_t count = 0;
if(emitted.insert(target).second)
{
- count = this->ProgressMap[target->GetName()].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)
@@ -905,12 +905,27 @@ void
cmGlobalUnixMakefileGenerator3::RecordTargetProgress(
cmMakefileTargetGenerator* tg)
{
- TargetProgress& tp = this->ProgressMap[tg->GetTarget()->GetName()];
+ TargetProgress& tp = this->ProgressMap[tg->GetTarget()];
tp.NumberOfActions = tg->GetNumberOfProgressActions();
tp.VariableFile = tg->GetProgressFileNameFull();
}
//----------------------------------------------------------------------------
+bool
+cmGlobalUnixMakefileGenerator3::ProgressMapCompare
+::operator()(cmTarget* l, cmTarget* r)
+{
+ // Order by target name.
+ if(int c = strcmp(l->GetName(), r->GetName()))
+ {
+ return c < 0;
+ }
+ // Order duplicate targets by binary directory.
+ return strcmp(l->GetMakefile()->GetCurrentOutputDirectory(),
+ r->GetMakefile()->GetCurrentOutputDirectory()) < 0;
+}
+
+//----------------------------------------------------------------------------
void
cmGlobalUnixMakefileGenerator3::TargetProgress
::WriteProgressVariables(unsigned long total, unsigned long &current)