diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index b8e2284cb8..937154647c 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -1101,9 +1101,10 @@ void cmComputeLinkInformation::AddTargetItem(std::string const& item, this->SharedLibrariesLinked.insert(target); } + cmGeneratorTarget *gtgt = this->GlobalGenerator->GetGeneratorTarget(target); // Handle case of an imported shared library with no soname. if(this->NoSONameUsesPath && - target->IsImportedSharedLibWithoutSOName(this->Config)) + gtgt->IsImportedSharedLibWithoutSOName(this->Config)) { this->AddSharedLibNoSOName(item); return; diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 8663593712..8ff78e06af 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -1338,6 +1338,19 @@ bool cmGeneratorTarget::IsChrpathUsed(const std::string& config) const 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( diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 0e41661037..49de6324e4 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -415,6 +415,10 @@ public: /** Whether this library defaults to \@rpath. */ 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: friend class cmTargetTraceDependencies; struct SourceEntry { std::vector Depends; }; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 88bda67129..3de7efed29 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2177,20 +2177,6 @@ const char* cmTarget::GetPrefixVariableInternal(bool implib) const 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 cmTarget::GetFullNameImported(const std::string& config, bool implib) const diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 6ba9772e13..16d01219a4 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -244,10 +244,6 @@ public: void 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? */ bool HasImplibGNUtoMS() const;