[Cmake-commits] [cmake-commits] king committed cmComputeLinkDepends.cxx 1.16 1.17 cmComputeLinkDepends.h 1.8 1.9 cmComputeLinkInformation.cxx 1.34 1.35 cmComputeLinkInformation.h 1.18 1.19
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Apr 30 18:04:50 EDT 2008
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv9067/Source
Modified Files:
cmComputeLinkDepends.cxx cmComputeLinkDepends.h
cmComputeLinkInformation.cxx cmComputeLinkInformation.h
Log Message:
ENH: When preserving potentially static portions of original user link lines recognize shared library names by their extension and skip them.
Index: cmComputeLinkDepends.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkDepends.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C 2 -d -r1.8 -r1.9
*** cmComputeLinkDepends.h 23 Apr 2008 04:40:19 -0000 1.8
--- cmComputeLinkDepends.h 30 Apr 2008 22:04:47 -0000 1.9
***************
*** 59,62 ****
--- 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:
***************
*** 138,141 ****
--- 142,146 ----
std::vector<int> OriginalEntries;
void PreserveOriginalEntries();
+ std::string SharedRegexString;
// Compatibility help.
Index: cmComputeLinkInformation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkInformation.cxx,v
retrieving revision 1.34
retrieving revision 1.35
diff -C 2 -d -r1.34 -r1.35
*** cmComputeLinkInformation.cxx 18 Apr 2008 21:32:15 -0000 1.34
--- cmComputeLinkInformation.cxx 30 Apr 2008 22:04:48 -0000 1.35
***************
*** 512,515 ****
--- 512,516 ----
cmComputeLinkDepends cld(this->Target, this->Config);
cld.SetOldLinkDirMode(this->OldLinkDirMode);
+ cld.SetSharedRegex(this->SharedRegexString);
cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute();
***************
*** 865,869 ****
{
std::string reg_shared = reg;
! reg_shared += this->CreateExtensionRegex(this->SharedLinkExtensions);
#ifdef CM_COMPUTE_LINK_INFO_DEBUG
fprintf(stderr, "shared regex [%s]\n", reg_shared.c_str());
--- 866,872 ----
{
std::string reg_shared = reg;
! this->SharedRegexString =
! this->CreateExtensionRegex(this->SharedLinkExtensions);
! reg_shared += this->SharedRegexString;
#ifdef CM_COMPUTE_LINK_INFO_DEBUG
fprintf(stderr, "shared regex [%s]\n", reg_shared.c_str());
Index: cmComputeLinkDepends.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkDepends.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -C 2 -d -r1.16 -r1.17
*** cmComputeLinkDepends.cxx 23 Apr 2008 04:40:19 -0000 1.16
--- cmComputeLinkDepends.cxx 30 Apr 2008 22:04:47 -0000 1.17
***************
*** 25,28 ****
--- 25,29 ----
#include <cmsys/stl/algorithm>
+ #include <cmsys/RegularExpression.hxx>
#include <assert.h>
***************
*** 199,202 ****
--- 200,209 ----
//----------------------------------------------------------------------------
+ void cmComputeLinkDepends::SetSharedRegex(std::string const& regex)
+ {
+ this->SharedRegexString = regex;
+ }
+
+ //----------------------------------------------------------------------------
std::vector<cmComputeLinkDepends::LinkEntry> const&
cmComputeLinkDepends::Compute()
***************
*** 875,878 ****
--- 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.
***************
*** 883,887 ****
{
cmTarget* tgt = this->EntryList[*in].Target;
! if(tgt && tgt->GetType() != cmTarget::STATIC_LIBRARY)
{
// Skip input items known to not be static libraries.
--- 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.
***************
*** 906,910 ****
{
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.
Index: cmComputeLinkInformation.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkInformation.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -C 2 -d -r1.18 -r1.19
*** cmComputeLinkInformation.h 21 Mar 2008 01:11:26 -0000 1.18
--- cmComputeLinkInformation.h 30 Apr 2008 22:04:48 -0000 1.19
***************
*** 130,133 ****
--- 130,134 ----
cmsys::RegularExpression ExtractSharedLibraryName;
cmsys::RegularExpression ExtractAnyLibraryName;
+ std::string SharedRegexString;
void AddLinkPrefix(const char* p);
void AddLinkExtension(const char* e, LinkType type);
More information about the Cmake-commits
mailing list