瀏覽代碼

BUG: repeat all -l options to avoid having to worry about link order.

Will Schroeder 25 年之前
父節點
當前提交
9f98906e92
共有 1 個文件被更改,包括 8 次插入3 次删除
  1. 8 3
      Source/cmUnixMakefileGenerator.cxx

+ 8 - 3
Source/cmUnixMakefileGenerator.cxx

@@ -187,6 +187,7 @@ void cmUnixMakefileGenerator::OutputExecutableRules(std::ostream& fout)
     linkLibs += *j;
     linkLibs += " ";
     }
+  std::string librariesLinked;
   std::vector<std::string>& libs = m_Makefile->GetLinkLibraries();
   for(j = libs.begin(); j != libs.end(); ++j)
     {
@@ -194,11 +195,15 @@ void cmUnixMakefileGenerator::OutputExecutableRules(std::ostream& fout)
     if((pos == std::string::npos || pos > 0)
        && (*j).find("${") == std::string::npos)
       {
-      linkLibs += "-l";
+      librariesLinked += "-l";
       }
-    linkLibs += *j;
-    linkLibs += " ";
+    librariesLinked += *j;
+    librariesLinked += " ";
     }
+  // Add these in twice so order does not matter
+  linkLibs += librariesLinked;
+  linkLibs += librariesLinked;
+  
   std::vector<std::string>& libsUnix = m_Makefile->GetLinkLibrariesUnix();
   for(j = libsUnix.begin(); j != libsUnix.end(); ++j)
     {