[Cmake-commits] [cmake-commits] king committed cmGlobalUnixMakefileGenerator3.cxx 1.139 1.140 cmGlobalUnixMakefileGenerator3.h 1.59 1.60

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Sep 28 17:34:25 EDT 2009


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv25926/Source

Modified Files:
	cmGlobalUnixMakefileGenerator3.cxx 
	cmGlobalUnixMakefileGenerator3.h 
Log Message:
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.


Index: cmGlobalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalUnixMakefileGenerator3.cxx,v
retrieving revision 1.139
retrieving revision 1.140
diff -C 2 -d -r1.139 -r1.140
*** cmGlobalUnixMakefileGenerator3.cxx	28 Sep 2009 15:42:41 -0000	1.139
--- cmGlobalUnixMakefileGenerator3.cxx	28 Sep 2009 21:34:22 -0000	1.140
***************
*** 751,755 ****
                                  cmLocalGenerator::SHELL);
          progCmd << " ";
!         std::vector<int> &progFiles = this->ProgressMap[t->first].Marks;
          for (std::vector<int>::iterator i = progFiles.begin();
                i != progFiles.end(); ++i)
--- 751,755 ----
                                  cmLocalGenerator::SHELL);
          progCmd << " ";
!         std::vector<int> &progFiles = this->ProgressMap[&t->second].Marks;
          for (std::vector<int>::iterator i = progFiles.begin();
                i != progFiles.end(); ++i)
***************
*** 874,878 ****
    if(emitted.insert(target).second)
      {
!     count = this->ProgressMap[target->GetName()].Marks.size();
      TargetDependSet const& depends = this->GetTargetDirectDepends(*target);
      for(TargetDependSet::const_iterator di = depends.begin();
--- 874,878 ----
    if(emitted.insert(target).second)
      {
!     count = this->ProgressMap[target].Marks.size();
      TargetDependSet const& depends = this->GetTargetDirectDepends(*target);
      for(TargetDependSet::const_iterator di = depends.begin();
***************
*** 906,910 ****
    cmMakefileTargetGenerator* tg)
  {
!   TargetProgress& tp = this->ProgressMap[tg->GetTarget()->GetName()];
    tp.NumberOfActions = tg->GetNumberOfProgressActions();
    tp.VariableFile = tg->GetProgressFileNameFull();
--- 906,910 ----
    cmMakefileTargetGenerator* tg)
  {
!   TargetProgress& tp = this->ProgressMap[tg->GetTarget()];
    tp.NumberOfActions = tg->GetNumberOfProgressActions();
    tp.VariableFile = tg->GetProgressFileNameFull();
***************
*** 912,915 ****
--- 912,930 ----
  
  //----------------------------------------------------------------------------
+ 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

Index: cmGlobalUnixMakefileGenerator3.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalUnixMakefileGenerator3.h,v
retrieving revision 1.59
retrieving revision 1.60
diff -C 2 -d -r1.59 -r1.60
*** cmGlobalUnixMakefileGenerator3.h	28 Sep 2009 15:42:41 -0000	1.59
--- cmGlobalUnixMakefileGenerator3.h	28 Sep 2009 21:34:23 -0000	1.60
***************
*** 181,185 ****
      void WriteProgressVariables(unsigned long total, unsigned long& current);
    };
!   typedef std::map<cmStdString, TargetProgress> ProgressMapType;
    ProgressMapType ProgressMap;
  
--- 181,187 ----
      void WriteProgressVariables(unsigned long total, unsigned long& current);
    };
!   struct ProgressMapCompare { bool operator()(cmTarget*,cmTarget*); };
!   typedef std::map<cmTarget*, TargetProgress,
!                    ProgressMapCompare> ProgressMapType;
    ProgressMapType ProgressMap;
  



More information about the Cmake-commits mailing list