summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-07 22:45:02 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-10-12 16:39:58 (GMT)
commitce8894aaf07871dbc58039e0ff0f22efaee7c014 (patch)
tree6e15b424ac3b6c340ee29e4abbc894666e61a191
parente5fb30fb5bdff2913cc9382649984da89e882b25 (diff)
downloadCMake-ce8894aaf07871dbc58039e0ff0f22efaee7c014.zip
CMake-ce8894aaf07871dbc58039e0ff0f22efaee7c014.tar.gz
CMake-ce8894aaf07871dbc58039e0ff0f22efaee7c014.tar.bz2
cmComputeLinkInformation: Port some implementation to cmGeneratorTarget.
-rw-r--r--Source/cmComputeLinkInformation.cxx24
-rw-r--r--Source/cmComputeLinkInformation.h4
2 files changed, 13 insertions, 15 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index c76cb7a..577e327 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -683,8 +683,8 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
this->Depends.push_back(lib);
}
- this->AddTargetItem(lib, tgt->Target);
- this->AddLibraryRuntimeInfo(lib, tgt->Target);
+ this->AddTargetItem(lib, tgt);
+ this->AddLibraryRuntimeInfo(lib, tgt);
}
}
else
@@ -766,7 +766,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item,
if(tgt)
{
lib = tgt->GetFullPath(this->Config, this->UseImportLibrary);
- this->AddLibraryRuntimeInfo(lib, tgt->Target);
+ this->AddLibraryRuntimeInfo(lib, tgt);
}
else
{
@@ -1077,7 +1077,7 @@ void cmComputeLinkInformation::SetCurrentLinkType(LinkType lt)
//----------------------------------------------------------------------------
void cmComputeLinkInformation::AddTargetItem(std::string const& item,
- cmTarget const* target)
+ cmGeneratorTarget const* target)
{
// This is called to handle a link item that is a full path to a target.
// If the target is not a static library make sure the link type is
@@ -1093,13 +1093,12 @@ void cmComputeLinkInformation::AddTargetItem(std::string const& item,
// Keep track of shared library targets linked.
if(target->GetType() == cmTarget::SHARED_LIBRARY)
{
- this->SharedLibrariesLinked.insert(target);
+ this->SharedLibrariesLinked.insert(target->Target);
}
- cmGeneratorTarget *gtgt = this->GlobalGenerator->GetGeneratorTarget(target);
// Handle case of an imported shared library with no soname.
if(this->NoSONameUsesPath &&
- gtgt->IsImportedSharedLibWithoutSOName(this->Config))
+ target->IsImportedSharedLibWithoutSOName(this->Config))
{
this->AddSharedLibNoSOName(item);
return;
@@ -1113,7 +1112,7 @@ void cmComputeLinkInformation::AddTargetItem(std::string const& item,
// For compatibility with CMake 2.4 include the item's directory in
// the linker search path.
- if(this->OldLinkDirMode && !target->IsFrameworkOnApple() &&
+ if(this->OldLinkDirMode && !target->Target->IsFrameworkOnApple() &&
this->OldLinkDirMask.find(cmSystemTools::GetFilenamePath(item)) ==
this->OldLinkDirMask.end())
{
@@ -1121,7 +1120,7 @@ void cmComputeLinkInformation::AddTargetItem(std::string const& item,
}
// Now add the full path to the library.
- this->Items.push_back(Item(item, true, target));
+ this->Items.push_back(Item(item, true, target->Target));
}
//----------------------------------------------------------------------------
@@ -1777,15 +1776,14 @@ cmComputeLinkInformation::GetRuntimeSearchPath()
//----------------------------------------------------------------------------
void
cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath,
- cmTarget const* target)
+ cmGeneratorTarget const* target)
{
- cmGeneratorTarget *gtgt = this->GlobalGenerator->GetGeneratorTarget(target);
// Ignore targets on Apple where install_name is not @rpath.
// The dependenty library can be found with other means such as
// @loader_path or full paths.
if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
{
- if(!gtgt->HasMacOSXRpathInstallNameDir(this->Config))
+ if(!target->HasMacOSXRpathInstallNameDir(this->Config))
{
return;
}
@@ -1807,7 +1805,7 @@ cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath,
// Try to get the soname of the library. Only files with this name
// could possibly conflict.
- std::string soName = gtgt->GetSOName(this->Config);
+ std::string soName = target->GetSOName(this->Config);
const char* soname = soName.empty()? 0 : soName.c_str();
// Include this library in the runtime path ordering.
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index b1e7e46..94c364d 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -129,7 +129,7 @@ private:
std::string NoCaseExpression(const char* str);
// Handling of link items.
- void AddTargetItem(std::string const& item, cmTarget const* target);
+ void AddTargetItem(std::string const& item, const cmGeneratorTarget* target);
void AddFullItem(std::string const& item);
bool CheckImplicitDirItem(std::string const& item);
void AddUserItem(std::string const& item, bool pathNotKnown);
@@ -183,7 +183,7 @@ private:
bool CMP0060Warn;
void AddLibraryRuntimeInfo(std::string const& fullPath,
- cmTarget const* target);
+ const cmGeneratorTarget* target);
void AddLibraryRuntimeInfo(std::string const& fullPath);
};