瀏覽代碼

BUG: When there are no link flags, we want an empty string, not a null pointer.

Brad King 23 年之前
父節點
當前提交
c8694bb509
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      Source/cmLocalUnixMakefileGenerator.cxx

+ 8 - 1
Source/cmLocalUnixMakefileGenerator.cxx

@@ -1000,12 +1000,19 @@ void cmLocalUnixMakefileGenerator::OutputStaticLibraryRule(std::ostream& fout,
     {
     targetSuffix = this->GetSafeDefinition("CMAKE_STATIC_LIBRARY_SUFFIX");
     }
+  std::string linkFlags;
+  const char* targetLinkFlags = t.GetProperty("LINK_FLAGS");
+  if(targetLinkFlags)
+    {
+    linkFlags += targetLinkFlags;
+    linkFlags += " ";
+    }
   this->OutputLibraryRule(fout, name, t,
                           targetPrefix,
                           targetSuffix,
                           createRule,
                           "static library",
-                          t.GetProperty("LINK_FLAGS"));
+                          linkFlags.c_str());
   
 }