Преглед изворни кода

cmGeneratorTarget: Move LinkLanguagePropagatesToDependents from cmTarget

Stephen Kelly пре 10 година
родитељ
комит
b397eae82e

+ 1 - 1
Source/cmGeneratorExpressionNode.cxx

@@ -999,7 +999,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
 
     if (propertyName == "LINKER_LANGUAGE")
       {
-      if (target->Target->LinkLanguagePropagatesToDependents() &&
+      if (target->LinkLanguagePropagatesToDependents() &&
           dagCheckerParent && (dagCheckerParent->EvaluatingLinkLibraries()
             || dagCheckerParent->EvaluatingSources()))
         {

+ 2 - 2
Source/cmGeneratorTarget.cxx

@@ -4770,7 +4770,7 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
     iface.WrongConfigLibraries = impl->WrongConfigLibraries;
     }
 
-  if(this->Target->LinkLanguagePropagatesToDependents())
+  if(this->LinkLanguagePropagatesToDependents())
     {
     // Targets using this archive need its language runtime libraries.
     if(cmLinkImplementation const* impl =
@@ -5485,7 +5485,7 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
   }
 
   // Get the link languages.
-  if(this->Target->LinkLanguagePropagatesToDependents())
+  if(this->LinkLanguagePropagatesToDependents())
     {
     std::string linkProp = "IMPORTED_LINK_INTERFACE_LANGUAGES";
     linkProp += suffix;

+ 3 - 0
Source/cmGeneratorTarget.h

@@ -189,6 +189,9 @@ public:
   std::set<std::string>const& GetUtilities() const;
   cmListFileBacktrace const* GetUtilityBacktrace(const std::string& u) const;
 
+  bool LinkLanguagePropagatesToDependents() const
+  { return this->GetType() == cmState::STATIC_LIBRARY; }
+
   /** Get the macro to define when building sources in this target.
       If no macro should be defined null is returned.  */
   const char* GetExportMacro() const;

+ 0 - 3
Source/cmTarget.h

@@ -227,9 +227,6 @@ public:
   std::set<std::string> const & GetSystemIncludeDirectories() const
     { return this->SystemIncludeDirectories; }
 
-  bool LinkLanguagePropagatesToDependents() const
-  { return this->TargetTypeValue == cmState::STATIC_LIBRARY; }
-
   cmStringRange GetIncludeDirectoriesEntries() const;
   cmBacktraceRange GetIncludeDirectoriesBacktraces() const;