فهرست منبع

cmGeneratorTarget: Move ComputeLinkImplementationLanguages from cmTarget.

Stephen Kelly 10 سال پیش
والد
کامیت
0431f2c4d7
4فایلهای تغییر یافته به همراه19 افزوده شده و 18 حذف شده
  1. 15 1
      Source/cmGeneratorTarget.cxx
  2. 4 0
      Source/cmGeneratorTarget.h
  3. 0 14
      Source/cmTarget.cxx
  4. 0 3
      Source/cmTarget.h

+ 15 - 1
Source/cmGeneratorTarget.cxx

@@ -4410,11 +4410,25 @@ cmGeneratorTarget::GetLinkImplementation(const std::string& config) const
   if(!impl.LanguagesDone)
     {
     impl.LanguagesDone = true;
-    this->Target->ComputeLinkImplementationLanguages(config, impl);
+    this->ComputeLinkImplementationLanguages(config, impl);
     }
   return &impl;
 }
 
+//----------------------------------------------------------------------------
+void cmGeneratorTarget::ComputeLinkImplementationLanguages(
+  const std::string& config,
+  cmOptionalLinkImplementation& impl) const
+{
+  // This target needs runtime libraries for its source languages.
+  std::set<std::string> languages;
+  // Get languages used in our source files.
+  this->Target->GetLanguages(languages, config);
+  // Copy the set of langauges to the link implementation.
+  impl.Languages.insert(impl.Languages.begin(),
+                        languages.begin(), languages.end());
+}
+
 //----------------------------------------------------------------------------
 bool cmGeneratorTarget::HaveBuildTreeRPATH(const std::string& config) const
 {

+ 4 - 0
Source/cmGeneratorTarget.h

@@ -201,6 +201,10 @@ public:
   cmLinkImplementation const*
     GetLinkImplementation(const std::string& config) const;
 
+  void ComputeLinkImplementationLanguages(const std::string& config,
+                                          cmOptionalLinkImplementation& impl
+                                          ) const;
+
   bool HaveBuildTreeRPATH(const std::string& config) const;
 
   /** Full path with trailing slash to the top-level directory

+ 0 - 14
Source/cmTarget.cxx

@@ -3704,20 +3704,6 @@ void cmTarget::ComputeLinkImplementationLibraries(
     }
 }
 
-//----------------------------------------------------------------------------
-void cmTarget::ComputeLinkImplementationLanguages(
-  const std::string& config,
-  cmOptionalLinkImplementation& impl) const
-{
-  // This target needs runtime libraries for its source languages.
-  std::set<std::string> languages;
-  // Get languages used in our source files.
-  this->GetLanguages(languages, config);
-  // Copy the set of langauges to the link implementation.
-  impl.Languages.insert(impl.Languages.begin(),
-                        languages.begin(), languages.end());
-}
-
 //----------------------------------------------------------------------------
 cmTarget const* cmTarget::FindTargetToLink(std::string const& name) const
 {

+ 0 - 3
Source/cmTarget.h

@@ -237,9 +237,6 @@ public:
   void ComputeLinkImplementationLibraries(const std::string& config,
                                           cmOptionalLinkImplementation& impl,
                                           cmTarget const* head) const;
-  void ComputeLinkImplementationLanguages(const std::string& config,
-                                          cmOptionalLinkImplementation& impl
-                                          ) const;
 
   cmOptionalLinkImplementation&
   GetLinkImplMap(std::string const& config) const;