cmGeneratorTarget: Move IsImportedSharedLibWithoutSOName from cmTarget.

This commit is contained in:
Stephen Kelly 2015-08-05 19:19:50 +02:00
parent 110fd2fba1
commit 3e428fdcb4
5 changed files with 19 additions and 19 deletions

View File

@ -1101,9 +1101,10 @@ void cmComputeLinkInformation::AddTargetItem(std::string const& item,
this->SharedLibrariesLinked.insert(target); this->SharedLibrariesLinked.insert(target);
} }
cmGeneratorTarget *gtgt = this->GlobalGenerator->GetGeneratorTarget(target);
// Handle case of an imported shared library with no soname. // Handle case of an imported shared library with no soname.
if(this->NoSONameUsesPath && if(this->NoSONameUsesPath &&
target->IsImportedSharedLibWithoutSOName(this->Config)) gtgt->IsImportedSharedLibWithoutSOName(this->Config))
{ {
this->AddSharedLibNoSOName(item); this->AddSharedLibNoSOName(item);
return; return;

View File

@ -1338,6 +1338,19 @@ bool cmGeneratorTarget::IsChrpathUsed(const std::string& config) const
return false; return false;
} }
//----------------------------------------------------------------------------
bool cmGeneratorTarget::IsImportedSharedLibWithoutSOName(
const std::string& config) const
{
if(this->IsImported() && this->GetType() == cmTarget::SHARED_LIBRARY)
{
if(cmTarget::ImportInfo const* info = this->Target->GetImportInfo(config))
{
return info->NoSOName;
}
}
return false;
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmGeneratorTarget::HasMacOSXRpathInstallNameDir( bool cmGeneratorTarget::HasMacOSXRpathInstallNameDir(

View File

@ -415,6 +415,10 @@ public:
/** Whether this library defaults to \@rpath. */ /** Whether this library defaults to \@rpath. */
bool MacOSXRpathInstallNameDirDefault() const; bool MacOSXRpathInstallNameDirDefault() const;
/** Test for special case of a third-party shared library that has
no soname at all. */
bool IsImportedSharedLibWithoutSOName(const std::string& config) const;
private: private:
friend class cmTargetTraceDependencies; friend class cmTargetTraceDependencies;
struct SourceEntry { std::vector<cmSourceFile*> Depends; }; struct SourceEntry { std::vector<cmSourceFile*> Depends; };

View File

@ -2177,20 +2177,6 @@ const char* cmTarget::GetPrefixVariableInternal(bool implib) const
return ""; return "";
} }
//----------------------------------------------------------------------------
bool cmTarget::IsImportedSharedLibWithoutSOName(
const std::string& config) const
{
if(this->IsImported() && this->GetType() == cmTarget::SHARED_LIBRARY)
{
if(cmTarget::ImportInfo const* info = this->GetImportInfo(config))
{
return info->NoSOName;
}
}
return false;
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string std::string
cmTarget::GetFullNameImported(const std::string& config, bool implib) const cmTarget::GetFullNameImported(const std::string& config, bool implib) const

View File

@ -244,10 +244,6 @@ public:
void void
GetTargetVersion(bool soversion, int& major, int& minor, int& patch) const; GetTargetVersion(bool soversion, int& major, int& minor, int& patch) const;
/** Test for special case of a third-party shared library that has
no soname at all. */
bool IsImportedSharedLibWithoutSOName(const std::string& config) const;
/** Does this target have a GNU implib to convert to MS format? */ /** Does this target have a GNU implib to convert to MS format? */
bool HasImplibGNUtoMS() const; bool HasImplibGNUtoMS() const;