|
@@ -24,6 +24,7 @@
|
|
|
#include "cmake.h"
|
|
#include "cmake.h"
|
|
|
|
|
|
|
|
#include <cmsys/stl/algorithm>
|
|
#include <cmsys/stl/algorithm>
|
|
|
|
|
+#include <cmsys/RegularExpression.hxx>
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
#include <assert.h>
|
|
|
|
|
|
|
@@ -197,6 +198,12 @@ void cmComputeLinkDepends::SetOldLinkDirMode(bool b)
|
|
|
this->OldLinkDirMode = b;
|
|
this->OldLinkDirMode = b;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+//----------------------------------------------------------------------------
|
|
|
|
|
+void cmComputeLinkDepends::SetSharedRegex(std::string const& regex)
|
|
|
|
|
+{
|
|
|
|
|
+ this->SharedRegexString = regex;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
|
std::vector<cmComputeLinkDepends::LinkEntry> const&
|
|
std::vector<cmComputeLinkDepends::LinkEntry> const&
|
|
|
cmComputeLinkDepends::Compute()
|
|
cmComputeLinkDepends::Compute()
|
|
@@ -874,6 +881,9 @@ void cmComputeLinkDepends::CheckWrongConfigItem(std::string const& item)
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
|
void cmComputeLinkDepends::PreserveOriginalEntries()
|
|
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
|
|
// Skip the part of the input sequence that already appears in the
|
|
|
// output.
|
|
// output.
|
|
|
std::vector<int>::const_iterator in = this->OriginalEntries.begin();
|
|
std::vector<int>::const_iterator in = this->OriginalEntries.begin();
|
|
@@ -882,7 +892,8 @@ void cmComputeLinkDepends::PreserveOriginalEntries()
|
|
|
out != this->FinalLinkOrder.end())
|
|
out != this->FinalLinkOrder.end())
|
|
|
{
|
|
{
|
|
|
cmTarget* tgt = this->EntryList[*in].Target;
|
|
cmTarget* tgt = this->EntryList[*in].Target;
|
|
|
- if(tgt && tgt->GetType() != cmTarget::STATIC_LIBRARY)
|
|
|
|
|
|
|
+ if((tgt && tgt->GetType() != cmTarget::STATIC_LIBRARY) ||
|
|
|
|
|
+ (!tgt && shared_lib.find(this->EntryList[*in].Item)))
|
|
|
{
|
|
{
|
|
|
// Skip input items known to not be static libraries.
|
|
// Skip input items known to not be static libraries.
|
|
|
++in;
|
|
++in;
|
|
@@ -905,7 +916,8 @@ void cmComputeLinkDepends::PreserveOriginalEntries()
|
|
|
while(in != this->OriginalEntries.end())
|
|
while(in != this->OriginalEntries.end())
|
|
|
{
|
|
{
|
|
|
cmTarget* tgt = this->EntryList[*in].Target;
|
|
cmTarget* tgt = this->EntryList[*in].Target;
|
|
|
- if(tgt && tgt->GetType() != cmTarget::STATIC_LIBRARY)
|
|
|
|
|
|
|
+ if((tgt && tgt->GetType() != cmTarget::STATIC_LIBRARY) ||
|
|
|
|
|
+ (!tgt && shared_lib.find(this->EntryList[*in].Item)))
|
|
|
{
|
|
{
|
|
|
// Skip input items known to not be static libraries.
|
|
// Skip input items known to not be static libraries.
|
|
|
++in;
|
|
++in;
|