Procházet zdrojové kódy

cmTarget: Remove target name from parameter list

Use the member state instead.
Stephen Kelly před 9 roky
rodič
revize
d9b5f0a301
3 změnil soubory, kde provedl 8 přidání a 9 odebrání
  1. 3 3
      Source/cmMakefile.cxx
  2. 3 4
      Source/cmTarget.cxx
  3. 2 2
      Source/cmTarget.h

+ 3 - 3
Source/cmMakefile.cxx

@@ -1242,7 +1242,7 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
       << "to executables with the ENABLE_EXPORTS property set.";
     this->IssueMessage(cmake::FATAL_ERROR, e.str());
   }
-  t->AddLinkLibrary(*this, target, lib, llt);
+  t->AddLinkLibrary(*this, lib, llt);
 }
 
 void cmMakefile::InitializeFromParent(cmMakefile* parent)
@@ -1808,7 +1808,7 @@ void cmMakefile::SetProjectName(std::string const& p)
   this->StateSnapshot.SetProjectName(p);
 }
 
-void cmMakefile::AddGlobalLinkInformation(const std::string& name,
+void cmMakefile::AddGlobalLinkInformation(const std::string& /* name */,
                                           cmTarget& target)
 {
   // for these targets do not add anything
@@ -1838,7 +1838,7 @@ void cmMakefile::AddGlobalLinkInformation(const std::string& name,
     this->LinkLibraries.begin();
   for (; i != this->LinkLibraries.end(); ++i) {
     // This is equivalent to the target_link_libraries plain signature.
-    target.AddLinkLibrary(*this, name, i->first, i->second);
+    target.AddLinkLibrary(*this, i->first, i->second);
     target.AppendProperty(
       "INTERFACE_LINK_LIBRARIES",
       target.GetDebugGeneratorExpressions(i->first, i->second).c_str());

+ 3 - 4
Source/cmTarget.cxx

@@ -578,8 +578,7 @@ void cmTarget::GetTllSignatureTraces(std::ostream& s, TLLSignature sig) const
   }
 }
 
-void cmTarget::AddLinkLibrary(cmMakefile& mf, const std::string& target,
-                              const std::string& lib,
+void cmTarget::AddLinkLibrary(cmMakefile& mf, const std::string& lib,
                               cmTargetLinkLibraryType llt)
 {
   cmTarget* tgt = this->Makefile->FindTargetToUse(lib);
@@ -597,7 +596,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, const std::string& target,
 
   if (cmGeneratorExpression::Find(lib) != std::string::npos ||
       (tgt && tgt->GetType() == cmState::INTERFACE_LIBRARY) ||
-      (target == lib)) {
+      (this->Name == lib)) {
     return;
   }
 
@@ -615,7 +614,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, const std::string& target,
   // and we removing one instance will break the link line. Duplicates
   // will be appropriately eliminated at emit time.
   if (this->RecordDependencies) {
-    std::string targetEntry = target;
+    std::string targetEntry = this->Name;
     targetEntry += "_LIB_DEPENDS";
     std::string dependencies;
     const char* old_val = mf.GetDefinition(targetEntry);

+ 2 - 2
Source/cmTarget.h

@@ -142,8 +142,8 @@ public:
    */
   void ClearDependencyInformation(cmMakefile& mf, const std::string& target);
 
-  void AddLinkLibrary(cmMakefile& mf, const std::string& target,
-                      const std::string& lib, cmTargetLinkLibraryType llt);
+  void AddLinkLibrary(cmMakefile& mf, const std::string& lib,
+                      cmTargetLinkLibraryType llt);
   enum TLLSignature
   {
     KeywordTLLSignature,