[Cmake-commits] [cmake-commits] king committed cmTarget.cxx 1.278 1.279 cmTarget.h 1.147 1.148

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Oct 5 09:07:02 EDT 2009


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

Modified Files:
	cmTarget.cxx cmTarget.h 
Log Message:
Invalidate target link info when necessary

In cmTarget we compute the link implementation, link interface, and link
closure structures on-demand and cache the results.  This commit teaches
cmTarget to invalidate results after a LINK_INTERFACE_* property changes
or a new link library is added.  We also clear the results at the end of
the Configure step to ensure the Generate step uses up-to-date results.


Index: cmTarget.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.h,v
retrieving revision 1.147
retrieving revision 1.148
diff -C 2 -d -r1.147 -r1.148
*** cmTarget.h	5 Oct 2009 13:06:44 -0000	1.147
--- cmTarget.h	5 Oct 2009 13:06:59 -0000	1.148
***************
*** 568,571 ****
--- 568,573 ----
    void ComputeLinkClosure(const char* config, LinkClosure& lc);
  
+   void ClearLinkMaps();
+ 
    void MaybeInvalidatePropertyCache(const char* prop);
  

Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.278
retrieving revision 1.279
diff -C 2 -d -r1.278 -r1.279
*** cmTarget.cxx	5 Oct 2009 13:06:44 -0000	1.278
--- cmTarget.cxx	5 Oct 2009 13:06:58 -0000	1.279
***************
*** 1031,1034 ****
--- 1031,1040 ----
  void cmTarget::FinishConfigure()
  {
+   // Erase any cached link information that might have been comptued
+   // on-demand during the configuration.  This ensures that build
+   // system generation uses up-to-date information even if other cache
+   // invalidation code in this source file is buggy.
+   this->ClearLinkMaps();
+ 
    // Do old-style link dependency analysis.
    this->AnalyzeLibDependencies(*this->Makefile);
***************
*** 1036,1039 ****
--- 1042,1053 ----
  
  //----------------------------------------------------------------------------
+ void cmTarget::ClearLinkMaps()
+ {
+   this->Internal->LinkImplMap.clear();
+   this->Internal->LinkInterfaceMap.clear();
+   this->Internal->LinkClosureMap.clear();
+ }
+ 
+ //----------------------------------------------------------------------------
  cmListFileBacktrace const& cmTarget::GetBacktrace() const
  {
***************
*** 1657,1660 ****
--- 1671,1675 ----
    this->LinkLibraries.push_back( tmp );
    this->OriginalLinkLibraries.push_back(tmp);
+   this->ClearLinkMaps();
  
    // Add the explicit dependency information for this target. This is
***************
*** 2024,2027 ****
--- 2039,2046 ----
      this->Internal->ImportInfoMap.clear();
      }
+   if(!this->IsImported() && strncmp(prop, "LINK_INTERFACE_", 15) == 0)
+     {
+     this->ClearLinkMaps();
+     }
  }
  



More information about the Cmake-commits mailing list