[Cmake-commits] [cmake-commits] hoffman committed cmComputeLinkDepends.cxx 1.12.2.4 1.12.2.5 cmComputeLinkDepends.h 1.5.2.4 1.5.2.5 cmComputeLinkInformation.cxx 1.24.2.8 1.24.2.9 cmLocalGenerator.cxx 1.269.2.4 1.269.2.5 cmOrderDirectories.cxx 1.4 1.4.2.1 cmOrderDirectories.h 1.1 1.1.2.1 cmSourceFileLocation.cxx 1.3.2.2 1.3.2.3

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Jul 30 14:54:51 EDT 2008


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

Modified Files:
      Tag: CMake-2-6
	cmComputeLinkDepends.cxx cmComputeLinkDepends.h 
	cmComputeLinkInformation.cxx cmLocalGenerator.cxx 
	cmOrderDirectories.cxx cmOrderDirectories.h 
	cmSourceFileLocation.cxx 
Log Message:
ENH: merge in from main tree RC 15


Index: cmComputeLinkDepends.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkDepends.h,v
retrieving revision 1.5.2.4
retrieving revision 1.5.2.5
diff -C 2 -d -r1.5.2.4 -r1.5.2.5
*** cmComputeLinkDepends.h	1 May 2008 16:35:39 -0000	1.5.2.4
--- cmComputeLinkDepends.h	30 Jul 2008 18:54:49 -0000	1.5.2.5
***************
*** 59,66 ****
      { return this->OldWrongConfigItems; }
  
-   /** Set a regular expression that matches strings ending in a shared
-       library extension.  */
-   void SetSharedRegex(std::string const& regex);
- 
  private:
  
--- 59,62 ----
***************
*** 142,146 ****
    std::vector<int> OriginalEntries;
    void PreserveOriginalEntries();
-   std::string SharedRegexString;
  
    // Compatibility help.
--- 138,141 ----

Index: cmSourceFileLocation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSourceFileLocation.cxx,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -C 2 -d -r1.3.2.2 -r1.3.2.3
*** cmSourceFileLocation.cxx	26 Jul 2008 03:23:54 -0000	1.3.2.2
--- cmSourceFileLocation.cxx	30 Jul 2008 18:54:49 -0000	1.3.2.3
***************
*** 18,21 ****
--- 18,23 ----
  
  #include "cmMakefile.h"
+ #include "cmLocalGenerator.h"
+ #include "cmGlobalGenerator.h"
  #include "cmSystemTools.h"
  
***************
*** 90,98 ****
    if(!ext.empty()) { ext = ext.substr(1); }
  
!   // TODO: Let enable-language specify extensions for each language.
!   cmMakefile const* mf = this->Makefile;
    const std::vector<std::string>& srcExts = mf->GetSourceExtensions();
    const std::vector<std::string>& hdrExts = mf->GetHeaderExtensions();
!   if(std::find(srcExts.begin(), srcExts.end(), ext) != srcExts.end() ||
       std::find(hdrExts.begin(), hdrExts.end(), ext) != hdrExts.end())
      {
--- 92,103 ----
    if(!ext.empty()) { ext = ext.substr(1); }
  
!   // The global generator checks extensions of enabled languages.
!   cmGlobalGenerator* gg =
!     this->Makefile->GetLocalGenerator()->GetGlobalGenerator();
!   cmMakefile* mf = this->Makefile;
    const std::vector<std::string>& srcExts = mf->GetSourceExtensions();
    const std::vector<std::string>& hdrExts = mf->GetHeaderExtensions();
!   if(gg->GetLanguageFromExtension(ext.c_str()) ||
!      std::find(srcExts.begin(), srcExts.end(), ext) != srcExts.end() ||
       std::find(hdrExts.begin(), hdrExts.end(), ext) != hdrExts.end())
      {
***************
*** 114,119 ****
        tryPath += "/";
        }
!     tryPath += this->Directory;
!     tryPath += "/";
      tryPath += this->Name;
      if(cmSystemTools::FileExists(tryPath.c_str(), true))
--- 119,127 ----
        tryPath += "/";
        }
!     if(!this->Directory.empty())
!       {
!       tryPath += this->Directory;
!       tryPath += "/";
!       }
      tryPath += this->Name;
      if(cmSystemTools::FileExists(tryPath.c_str(), true))

Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.269.2.4
retrieving revision 1.269.2.5
diff -C 2 -d -r1.269.2.4 -r1.269.2.5
*** cmLocalGenerator.cxx	22 Jul 2008 18:04:24 -0000	1.269.2.4
--- cmLocalGenerator.cxx	30 Jul 2008 18:54:49 -0000	1.269.2.5
***************
*** 1631,1635 ****
        this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT_DEFAULT");
      bool flagsUsed = false;
!     if(osxArch && sysroot  && lang && lang[0] =='C')
        { 
        std::vector<std::string> archs;
--- 1631,1635 ----
        this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT_DEFAULT");
      bool flagsUsed = false;
!     if(osxArch && sysroot  && lang && (lang[0] =='C' || lang[0] == 'F'))
        { 
        std::vector<std::string> archs;

Index: cmComputeLinkInformation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkInformation.cxx,v
retrieving revision 1.24.2.8
retrieving revision 1.24.2.9
diff -C 2 -d -r1.24.2.8 -r1.24.2.9
*** cmComputeLinkInformation.cxx	28 Jul 2008 15:31:35 -0000	1.24.2.8
--- cmComputeLinkInformation.cxx	30 Jul 2008 18:54:49 -0000	1.24.2.9
***************
*** 257,264 ****
    // Allocate internals.
    this->OrderLinkerSearchPath =
!     new cmOrderDirectories(this->GlobalGenerator, target->GetName(),
                             "linker search path");
    this->OrderRuntimeSearchPath =
!     new cmOrderDirectories(this->GlobalGenerator, target->GetName(),
                             "runtime search path");
    this->OrderDependentRPath = 0;
--- 257,264 ----
    // Allocate internals.
    this->OrderLinkerSearchPath =
!     new cmOrderDirectories(this->GlobalGenerator, target,
                             "linker search path");
    this->OrderRuntimeSearchPath =
!     new cmOrderDirectories(this->GlobalGenerator, target,
                             "runtime search path");
    this->OrderDependentRPath = 0;
***************
*** 363,367 ****
      this->SharedDependencyMode = SharedDepModeDir;
      this->OrderDependentRPath =
!       new cmOrderDirectories(this->GlobalGenerator, target->GetName(),
                               "dependent library path");
      }
--- 363,367 ----
      this->SharedDependencyMode = SharedDepModeDir;
      this->OrderDependentRPath =
!       new cmOrderDirectories(this->GlobalGenerator, target,
                               "dependent library path");
      }
***************
*** 512,516 ****
    cmComputeLinkDepends cld(this->Target, this->Config);
    cld.SetOldLinkDirMode(this->OldLinkDirMode);
-   cld.SetSharedRegex(this->SharedRegexString);
    cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute();
  
--- 512,515 ----
***************
*** 1132,1135 ****
--- 1131,1138 ----
    // library for the architecture at link time.
    this->AddUserItem(file, false);
+ 
+   // Make sure the link directory ordering will find the library.
+   this->OrderLinkerSearchPath->AddLinkLibrary(item);
+ 
    return true;
  }
***************
*** 1363,1366 ****
--- 1366,1377 ----
                                                   std::string const& file)
  {
+   // Do not depend on things that do not exist.
+   std::vector<std::string>::iterator i =
+     std::find(this->Depends.begin(), this->Depends.end(), item);
+   if(i != this->Depends.end())
+     {
+     this->Depends.erase(i);
+     }
+ 
    // Tell the linker to search for the item and provide the proper
    // path for it.  Do not contribute to any CMP0003 warning (do not

Index: cmComputeLinkDepends.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkDepends.cxx,v
retrieving revision 1.12.2.4
retrieving revision 1.12.2.5
diff -C 2 -d -r1.12.2.4 -r1.12.2.5
*** cmComputeLinkDepends.cxx	1 May 2008 16:35:39 -0000	1.12.2.4
--- cmComputeLinkDepends.cxx	30 Jul 2008 18:54:49 -0000	1.12.2.5
***************
*** 25,29 ****
  
  #include <cmsys/stl/algorithm>
- #include <cmsys/RegularExpression.hxx>
  
  #include <assert.h>
--- 25,28 ----
***************
*** 200,209 ****
  
  //----------------------------------------------------------------------------
- void cmComputeLinkDepends::SetSharedRegex(std::string const& regex)
- {
-   this->SharedRegexString = regex;
- }
- 
- //----------------------------------------------------------------------------
  std::vector<cmComputeLinkDepends::LinkEntry> const&
  cmComputeLinkDepends::Compute()
--- 199,202 ----
***************
*** 882,888 ****
  void cmComputeLinkDepends::PreserveOriginalEntries()
  {
-   // Regular expression to match shared libraries.
-   cmsys::RegularExpression shared_lib(this->SharedRegexString.c_str());
- 
    // Skip the part of the input sequence that already appears in the
    // output.
--- 875,878 ----
***************
*** 893,898 ****
      {
      cmTarget* tgt = this->EntryList[*in].Target;
!     if((tgt && tgt->GetType() != cmTarget::STATIC_LIBRARY) ||
!        (!tgt && shared_lib.find(this->EntryList[*in].Item)))
        {
        // Skip input items known to not be static libraries.
--- 883,887 ----
      {
      cmTarget* tgt = this->EntryList[*in].Target;
!     if(tgt && tgt->GetType() != cmTarget::STATIC_LIBRARY)
        {
        // Skip input items known to not be static libraries.
***************
*** 917,922 ****
      {
      cmTarget* tgt = this->EntryList[*in].Target;
!     if((tgt && tgt->GetType() != cmTarget::STATIC_LIBRARY) ||
!        (!tgt && shared_lib.find(this->EntryList[*in].Item)))
        {
        // Skip input items known to not be static libraries.
--- 906,910 ----
      {
      cmTarget* tgt = this->EntryList[*in].Target;
!     if(tgt && tgt->GetType() != cmTarget::STATIC_LIBRARY)
        {
        // Skip input items known to not be static libraries.

Index: cmOrderDirectories.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmOrderDirectories.cxx,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -C 2 -d -r1.4 -r1.4.2.1
*** cmOrderDirectories.cxx	22 Feb 2008 14:44:11 -0000	1.4
--- cmOrderDirectories.cxx	30 Jul 2008 18:54:49 -0000	1.4.2.1
***************
*** 19,22 ****
--- 19,23 ----
  #include "cmGlobalGenerator.h"
  #include "cmSystemTools.h"
+ #include "cmake.h"
  
  #include <assert.h>
***************
*** 57,61 ****
      for(unsigned int i=0; i < this->OD->OriginalDirectories.size(); ++i)
        {
!       // Check if this directory conflicts with they entry.
        std::string const& dir = this->OD->OriginalDirectories[i];
        if(dir != this->Directory && this->FindConflict(dir))
--- 58,62 ----
      for(unsigned int i=0; i < this->OD->OriginalDirectories.size(); ++i)
        {
!       // Check if this directory conflicts with the entry.
        std::string const& dir = this->OD->OriginalDirectories[i];
        if(dir != this->Directory && this->FindConflict(dir))
***************
*** 69,72 ****
--- 70,96 ----
        }
      }
+ 
+   void FindImplicitConflicts(cmOStringStream& w)
+     {
+     bool first = true;
+     for(unsigned int i=0; i < this->OD->OriginalDirectories.size(); ++i)
+       {
+       // Check if this directory conflicts with the entry.
+       std::string const& dir = this->OD->OriginalDirectories[i];
+       if(dir != this->Directory && this->FindConflict(dir))
+         {
+         // The library will be found in this directory but it is
+         // supposed to be found in an implicit search directory.
+         if(first)
+           {
+           first = false;
+           w << "  ";
+           this->Report(w);
+           w << " in " << this->Directory << " may be hidden by files in:\n";
+           }
+         w << "    " << dir << "\n";
+         }
+       }
+     }
  protected:
    virtual bool FindConflict(std::string const& dir) = 0;
***************
*** 240,248 ****
  //----------------------------------------------------------------------------
  cmOrderDirectories::cmOrderDirectories(cmGlobalGenerator* gg,
!                                        const char* name,
                                         const char* purpose)
  {
    this->GlobalGenerator = gg;
!   this->Name = name;
    this->Purpose = purpose;
    this->Computed = false;
--- 264,272 ----
  //----------------------------------------------------------------------------
  cmOrderDirectories::cmOrderDirectories(cmGlobalGenerator* gg,
!                                        cmTarget* target,
                                         const char* purpose)
  {
    this->GlobalGenerator = gg;
!   this->Target = target;
    this->Purpose = purpose;
    this->Computed = false;
***************
*** 258,261 ****
--- 282,291 ----
      delete *i;
      }
+   for(std::vector<cmOrderDirectoriesConstraint*>::iterator
+         i = this->ImplicitDirEntries.begin();
+       i != this->ImplicitDirEntries.end(); ++i)
+     {
+     delete *i;
+     }
  }
  
***************
*** 280,284 ****
    if(this->EmmittedConstraintSOName.insert(fullPath).second)
      {
!     // Avoid dealing with implicit directories.
      if(!this->ImplicitDirectories.empty())
        {
--- 310,314 ----
    if(this->EmmittedConstraintSOName.insert(fullPath).second)
      {
!     // Implicit link directories need special handling.
      if(!this->ImplicitDirectories.empty())
        {
***************
*** 287,290 ****
--- 317,322 ----
           this->ImplicitDirectories.end())
          {
+         this->ImplicitDirEntries.push_back(
+           new cmOrderDirectoriesConstraintSOName(this, fullPath, soname));
          return;
          }
***************
*** 313,317 ****
    if(this->EmmittedConstraintLibrary.insert(fullPath).second)
      {
!     // Avoid dealing with implicit directories.
      if(!this->ImplicitDirectories.empty())
        {
--- 345,349 ----
    if(this->EmmittedConstraintLibrary.insert(fullPath).second)
      {
!     // Implicit link directories need special handling.
      if(!this->ImplicitDirectories.empty())
        {
***************
*** 320,323 ****
--- 352,357 ----
           this->ImplicitDirectories.end())
          {
+         this->ImplicitDirEntries.push_back(
+           new cmOrderDirectoriesConstraintLibrary(this, fullPath));
          return;
          }
***************
*** 367,371 ****
        di != this->UserDirectories.end(); ++di)
      {
!     // Avoid dealing with implicit directories.
      if(this->ImplicitDirectories.find(*di) !=
         this->ImplicitDirectories.end())
--- 401,405 ----
        di != this->UserDirectories.end(); ++di)
      {
!     // We never explicitly specify implicit link directories.
      if(this->ImplicitDirectories.find(*di) !=
         this->ImplicitDirectories.end())
***************
*** 450,453 ****
--- 484,520 ----
      i->erase(last, i->end());
      }
+ 
+   // Check items in implicit link directories.
+   this->FindImplicitConflicts();
+ }
+ 
+ //----------------------------------------------------------------------------
+ void cmOrderDirectories::FindImplicitConflicts()
+ {
+   // Check for items in implicit link directories that have conflicts
+   // in the explicit directories.
+   cmOStringStream conflicts;
+   for(unsigned int i=0; i < this->ImplicitDirEntries.size(); ++i)
+     {
+     this->ImplicitDirEntries[i]->FindImplicitConflicts(conflicts);
+     }
+ 
+   // Skip warning if there were no conflicts.
+   std::string text = conflicts.str();
+   if(text.empty())
+     {
+     return;
+     }
+ 
+   // Warn about the conflicts.
+   cmOStringStream w;
+   w << "Cannot generate a safe " << this->Purpose
+     << " for target " << this->Target->GetName()
+     << " because files in some directories may conflict with "
+     << " libraries in implicit directories:\n"
+     << text
+     << "Some of these libraries may not be found correctly.";
+   this->GlobalGenerator->GetCMakeInstance()
+     ->IssueMessage(cmake::WARNING, w.str(), this->Target->GetBacktrace());
  }
  
***************
*** 511,516 ****
    // Construct the message.
    cmOStringStream e;
!   e << "WARNING: Cannot generate a safe " << this->Purpose
!     << " for target " << this->Name
      << " because there is a cycle in the constraint graph:\n";
  
--- 578,583 ----
    // Construct the message.
    cmOStringStream e;
!   e << "Cannot generate a safe " << this->Purpose
!     << " for target " << this->Target->GetName()
      << " because there is a cycle in the constraint graph:\n";
  
***************
*** 519,531 ****
      {
      ConflictList const& clist = this->ConflictGraph[i];
!     e << "dir " << i << " is [" << this->OriginalDirectories[i] << "]\n";
      for(ConflictList::const_iterator j = clist.begin();
          j != clist.end(); ++j)
        {
!       e << "  dir " << j->first << " must precede it due to ";
        this->ConstraintEntries[j->second]->Report(e);
        e << "\n";
        }
      }
!   cmSystemTools::Message(e.str().c_str());
  }
--- 586,600 ----
      {
      ConflictList const& clist = this->ConflictGraph[i];
!     e << "  dir " << i << " is [" << this->OriginalDirectories[i] << "]\n";
      for(ConflictList::const_iterator j = clist.begin();
          j != clist.end(); ++j)
        {
!       e << "    dir " << j->first << " must precede it due to ";
        this->ConstraintEntries[j->second]->Report(e);
        e << "\n";
        }
      }
!   e << "Some of these libraries may not be found correctly.";
!   this->GlobalGenerator->GetCMakeInstance()
!     ->IssueMessage(cmake::WARNING, e.str(), this->Target->GetBacktrace());
  }

Index: cmOrderDirectories.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmOrderDirectories.h,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -C 2 -d -r1.1 -r1.1.2.1
*** cmOrderDirectories.h	21 Feb 2008 16:41:11 -0000	1.1
--- cmOrderDirectories.h	30 Jul 2008 18:54:49 -0000	1.1.2.1
***************
*** 25,28 ****
--- 25,29 ----
  class cmOrderDirectoriesConstraint;
  class cmOrderDirectoriesConstraintLibrary;
+ class cmTarget;
  
  /** \class cmOrderDirectories
***************
*** 32,36 ****
  {
  public:
!   cmOrderDirectories(cmGlobalGenerator* gg, const char* name,
                       const char* purpose);
    ~cmOrderDirectories();
--- 33,37 ----
  {
  public:
!   cmOrderDirectories(cmGlobalGenerator* gg, cmTarget* target,
                       const char* purpose);
    ~cmOrderDirectories();
***************
*** 45,49 ****
  private:
    cmGlobalGenerator* GlobalGenerator;
!   std::string Name;
    std::string Purpose;
  
--- 46,50 ----
  private:
    cmGlobalGenerator* GlobalGenerator;
!   cmTarget* Target;
    std::string Purpose;
  
***************
*** 54,57 ****
--- 55,59 ----
    bool OrderedDirectoriesComputed;
    std::vector<cmOrderDirectoriesConstraint*> ConstraintEntries;
+   std::vector<cmOrderDirectoriesConstraint*> ImplicitDirEntries;
    std::vector<std::string> UserDirectories;
    cmsys::RegularExpression RemoveLibraryExtension;
***************
*** 66,69 ****
--- 68,72 ----
    int AddOriginalDirectory(std::string const& dir);
    void FindConflicts();
+   void FindImplicitConflicts();
    void OrderDirectories();
    void VisitDirectory(unsigned int i);



More information about the Cmake-commits mailing list