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

This commit is contained in:
Will Schroeder 2001-03-02 13:47:33 -05:00
parent b6d1cda20e
commit 9f98906e92
1 changed files with 8 additions and 3 deletions

View File

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