浏览代码

cmGeneratorTarget: Move IsImportedSharedLibWithoutSOName from cmTarget.

Stephen Kelly 10 年之前
父节点
当前提交
3e428fdcb4
共有 5 个文件被更改,包括 19 次插入19 次删除
  1. 2 1
      Source/cmComputeLinkInformation.cxx
  2. 13 0
      Source/cmGeneratorTarget.cxx
  3. 4 0
      Source/cmGeneratorTarget.h
  4. 0 14
      Source/cmTarget.cxx
  5. 0 4
      Source/cmTarget.h

+ 2 - 1
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;

+ 13 - 0
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(

+ 4 - 0
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<cmSourceFile*> Depends; };

+ 0 - 14
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

+ 0 - 4
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;