فهرست منبع

does not need a second argument

Ken Martin 23 سال پیش
والد
کامیت
6bbc8e9d45
1فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 7 1
      Source/cmTargetLinkLibrariesCommand.cxx

+ 7 - 1
Source/cmTargetLinkLibrariesCommand.cxx

@@ -19,11 +19,17 @@
 // cmTargetLinkLibrariesCommand
 bool cmTargetLinkLibrariesCommand::InitialPass(std::vector<std::string> const& argsIn)
 {
-  if(argsIn.size() < 2)
+  // must have one argument
+  if(argsIn.size() < 1)
     {
     this->SetError("called with incorrect number of arguments");
     return false;
     }
+  // but we might not have any libs after variable expansion
+  if(argsIn.size() < 2)
+    {
+    return true;
+    }
   std::vector<std::string> args;
   cmSystemTools::ExpandListArguments(argsIn, args);
   // add libraries, nothe that there is an optional prefix