1
0
Эх сурвалжийг харах

cmMakefile: Inline method into only caller

cmMakefile should not have API which is only useful for deprecated
systems like cmPluginAPI.
Stephen Kelly 9 жил өмнө
parent
commit
2b7baed719

+ 8 - 1
Source/cmCPluginAPI.cxx

@@ -162,7 +162,14 @@ void CCONV cmAddLinkDirectoryForTarget(void* arg, const char* tgt,
                                        const char* d)
 {
   cmMakefile* mf = static_cast<cmMakefile*>(arg);
-  mf->AddLinkDirectoryForTarget(tgt, d);
+  cmTarget* t = mf->FindLocalNonAliasTarget(tgt);
+  if (!t) {
+    cmSystemTools::Error(
+      "Attempt to add link directories to non-existent target: ", tgt,
+      " for directory ", d);
+    return;
+  }
+  t->AddLinkDirectory(d);
 }
 
 void CCONV cmAddExecutable(void* arg, const char* exename, int numSrcs,

+ 0 - 14
Source/cmMakefile.cxx

@@ -1245,20 +1245,6 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
   i->second.AddLinkLibrary(*this, target, lib, llt);
 }
 
-void cmMakefile::AddLinkDirectoryForTarget(const std::string& target,
-                                           const std::string& d)
-{
-  cmTarget* t = this->FindLocalNonAliasTarget(target);
-  if (!t) {
-    cmSystemTools::Error(
-      "Attempt to add link directories to non-existent target: ",
-      target.c_str(), " for directory ", d.c_str());
-    return;
-  }
-
-  t->AddLinkDirectory(d);
-}
-
 void cmMakefile::InitializeFromParent(cmMakefile* parent)
 {
   this->SystemIncludeDirectories = parent->SystemIncludeDirectories;

+ 0 - 1
Source/cmMakefile.h

@@ -202,7 +202,6 @@ public:
   void AddLinkLibrary(const std::string&, cmTargetLinkLibraryType type);
   void AddLinkLibraryForTarget(const std::string& tgt, const std::string&,
                                cmTargetLinkLibraryType type);
-  void AddLinkDirectoryForTarget(const std::string& tgt, const std::string& d);
 
   /**
    * Add a subdirectory to the build.