BUG: fixed so that empty library paths are ignored
This commit is contained in:
parent
f055e512ae
commit
80aad5e3b2
@ -335,6 +335,10 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
|
|||||||
outputRuntime = false;
|
outputRuntime = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Some search paths should never be emitted
|
||||||
|
emitted.insert("");
|
||||||
|
emitted.insert("/usr/lib");
|
||||||
|
|
||||||
// collect all the flags needed for linking libraries
|
// collect all the flags needed for linking libraries
|
||||||
std::string linkLibs;
|
std::string linkLibs;
|
||||||
std::vector<std::string>& libdirs = m_Makefile->GetLinkDirectories();
|
std::vector<std::string>& libdirs = m_Makefile->GetLinkDirectories();
|
||||||
@ -352,10 +356,6 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
|
|||||||
emitted.insert(libpath);
|
emitted.insert(libpath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(libpath == "/usr/lib" )
|
|
||||||
{
|
|
||||||
emitted.insert(libpath);
|
|
||||||
}
|
|
||||||
if(emitted.insert(libpath).second)
|
if(emitted.insert(libpath).second)
|
||||||
{
|
{
|
||||||
std::string::size_type pos = libDir->find("-L");
|
std::string::size_type pos = libDir->find("-L");
|
||||||
@ -395,17 +395,14 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
|
|||||||
cmSystemTools::SplitProgramPath(lib->first.c_str(),
|
cmSystemTools::SplitProgramPath(lib->first.c_str(),
|
||||||
dir, file);
|
dir, file);
|
||||||
std::string libpath = cmSystemTools::EscapeSpaces(dir.c_str());
|
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";
|
runtimeDirs.push_back( libpath );
|
||||||
linkLibs += libpath;
|
|
||||||
linkLibs += " ";
|
|
||||||
if(outputRuntime)
|
|
||||||
{
|
|
||||||
runtimeDirs.push_back( libpath );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cmRegularExpression libname("lib(.*)\\.(.*)");
|
cmRegularExpression libname("lib(.*)\\.(.*)");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user