Просмотр исходного кода

cmTargetLinkLibrariesCommand: Use a string argument

Ben Boeckel 12 лет назад
Родитель
Сommit
466abd846f
2 измененных файлов с 6 добавлено и 6 удалено
  1. 5 5
      Source/cmTargetLinkLibrariesCommand.cxx
  2. 1 1
      Source/cmTargetLinkLibrariesCommand.h

+ 5 - 5
Source/cmTargetLinkLibrariesCommand.cxx

@@ -272,7 +272,7 @@ bool cmTargetLinkLibrariesCommand
       {
       // The link type was specified by the previous argument.
       haveLLT = false;
-      if (!this->HandleLibrary(args[i].c_str(), llt))
+      if (!this->HandleLibrary(args[i], llt))
         {
         return false;
         }
@@ -301,7 +301,7 @@ bool cmTargetLinkLibrariesCommand
           llt = cmTarget::OPTIMIZED;
           }
         }
-      if (!this->HandleLibrary(args[i].c_str(), llt))
+      if (!this->HandleLibrary(args[i], llt))
         {
         return false;
         }
@@ -352,7 +352,7 @@ cmTargetLinkLibrariesCommand
 
 //----------------------------------------------------------------------------
 bool
-cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
+cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
                                             cmTarget::LinkLibraryType llt)
 {
   if(this->Target->GetType() == cmTarget::INTERFACE_LIBRARY
@@ -479,13 +479,13 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
       {
       prop = "LINK_INTERFACE_LIBRARIES_";
       prop += *i;
-      this->Target->AppendProperty(prop.c_str(), lib);
+      this->Target->AppendProperty(prop.c_str(), lib.c_str());
       }
     }
   if(llt == cmTarget::OPTIMIZED || llt == cmTarget::GENERAL)
     {
     // Put in the non-DEBUG configuration interfaces.
-    this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES", lib);
+    this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES", lib.c_str());
 
     // Make sure the DEBUG configuration interfaces exist so that the
     // general one will not be used as a fall-back.

+ 1 - 1
Source/cmTargetLinkLibrariesCommand.h

@@ -62,7 +62,7 @@ private:
 
   ProcessingState CurrentProcessingState;
 
-  bool HandleLibrary(const char* lib, cmTarget::LinkLibraryType llt);
+  bool HandleLibrary(const std::string& lib, cmTarget::LinkLibraryType llt);
 };