BUG: fixed so that empty library paths are ignored

This commit is contained in:
Amitha Perera 2001-06-15 10:35:06 -04:00
parent f055e512ae
commit 80aad5e3b2
1 changed files with 10 additions and 13 deletions

View File

@ -335,6 +335,10 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
outputRuntime = false;
}
// Some search paths should never be emitted
emitted.insert("");
emitted.insert("/usr/lib");
// collect all the flags needed for linking libraries
std::string linkLibs;
std::vector<std::string>& libdirs = m_Makefile->GetLinkDirectories();
@ -352,10 +356,6 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
emitted.insert(libpath);
}
}
if(libpath == "/usr/lib" )
{
emitted.insert(libpath);
}
if(emitted.insert(libpath).second)
{
std::string::size_type pos = libDir->find("-L");
@ -395,17 +395,14 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
cmSystemTools::SplitProgramPath(lib->first.c_str(),
dir, file);
std::string libpath = cmSystemTools::EscapeSpaces(dir.c_str());
if(libpath != "/usr/lib")
if(emitted.insert(libpath).second)
{
if(emitted.insert(libpath).second)
linkLibs += "-L";
linkLibs += libpath;
linkLibs += " ";
if(outputRuntime)
{
linkLibs += "-L";
linkLibs += libpath;
linkLibs += " ";
if(outputRuntime)
{
runtimeDirs.push_back( libpath );
}
runtimeDirs.push_back( libpath );
}
}
cmRegularExpression libname("lib(.*)\\.(.*)");