Pārlūkot izejas kodu

cmGeneratorTarget: Move ComputeVersionedName from cmTarget.

Stephen Kelly 10 gadi atpakaļ
vecāks
revīzija
beff29f0d4
4 mainītis faili ar 26 papildinājumiem un 26 dzēšanām
  1. 19 2
      Source/cmGeneratorTarget.cxx
  2. 7 0
      Source/cmGeneratorTarget.h
  3. 0 17
      Source/cmTarget.cxx
  4. 0 7
      Source/cmTarget.h

+ 19 - 2
Source/cmGeneratorTarget.cxx

@@ -3250,11 +3250,11 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name,
   else
   {
     // The library's soname.
-    this->Target->ComputeVersionedName(soName, prefix, base, suffix,
+    this->ComputeVersionedName(soName, prefix, base, suffix,
                               name, soversion);
 
     // The library's real name on disk.
-    this->Target->ComputeVersionedName(realName, prefix, base, suffix,
+    this->ComputeVersionedName(realName, prefix, base, suffix,
                               name, version);
   }
 
@@ -4436,6 +4436,23 @@ void cmGeneratorTarget::GetTargetVersion(bool soversion,
     }
 }
 
+//----------------------------------------------------------------------------
+void cmGeneratorTarget::ComputeVersionedName(std::string& vName,
+                                    std::string const& prefix,
+                                    std::string const& base,
+                                    std::string const& suffix,
+                                    std::string const& name,
+                                    const char* version) const
+{
+  vName = this->Makefile->IsOn("APPLE") ? (prefix+base) : name;
+  if(version)
+    {
+    vName += ".";
+    vName += version;
+    }
+  vName += this->Makefile->IsOn("APPLE") ? suffix : std::string();
+}
+
 //----------------------------------------------------------------------------
 void
 cmGeneratorTarget::ReportPropertyOrigin(const std::string &p,

+ 7 - 0
Source/cmGeneratorTarget.h

@@ -483,6 +483,13 @@ private:
   // Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type.
   const char* GetOutputTargetType(bool implib) const;
 
+  void ComputeVersionedName(std::string& vName,
+                            std::string const& prefix,
+                            std::string const& base,
+                            std::string const& suffix,
+                            std::string const& name,
+                            const char* version) const;
+
   struct CompatibleInterfacesBase
   {
     std::set<std::string> PropsBool;

+ 0 - 17
Source/cmTarget.cxx

@@ -2118,23 +2118,6 @@ cmTarget::ImportedGetFullPath(const std::string& config, bool pimplib) const
   return result;
 }
 
-//----------------------------------------------------------------------------
-void cmTarget::ComputeVersionedName(std::string& vName,
-                                    std::string const& prefix,
-                                    std::string const& base,
-                                    std::string const& suffix,
-                                    std::string const& name,
-                                    const char* version) const
-{
-  vName = this->IsApple? (prefix+base) : name;
-  if(version)
-    {
-    vName += ".";
-    vName += version;
-    }
-  vName += this->IsApple? suffix : std::string();
-}
-
 //----------------------------------------------------------------------------
 void cmTarget::SetPropertyDefault(const std::string& property,
                                   const char* default_value)

+ 0 - 7
Source/cmTarget.h

@@ -414,13 +414,6 @@ private:
   friend class cmGeneratorTarget;
   friend class cmTargetTraceDependencies;
 
-  void ComputeVersionedName(std::string& vName,
-                            std::string const& prefix,
-                            std::string const& base,
-                            std::string const& suffix,
-                            std::string const& name,
-                            const char* version) const;
-
   cmListFileBacktrace Backtrace;
 };