diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2001-05-22 21:49:18 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2001-05-22 21:49:18 (GMT) |
commit | 52e83c7afde624bf639828e1cb811ca83ef1d1dc (patch) | |
tree | 93bdb66234ddda73d30bf051c6211b4b7ff26eab /Source/cmUnixMakefileGenerator.cxx | |
parent | 7950871fcb36c3fe9047b1e852def7d940cb35ad (diff) | |
download | CMake-52e83c7afde624bf639828e1cb811ca83ef1d1dc.zip CMake-52e83c7afde624bf639828e1cb811ca83ef1d1dc.tar.gz CMake-52e83c7afde624bf639828e1cb811ca83ef1d1dc.tar.bz2 |
BUG: do not include /usr/lib in -L
Diffstat (limited to 'Source/cmUnixMakefileGenerator.cxx')
-rw-r--r-- | Source/cmUnixMakefileGenerator.cxx | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index ff3d29e..fc5203b 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -243,14 +243,18 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout, for(std::vector<std::string>::iterator libDir = libdirs.begin(); libDir != libdirs.end(); ++libDir) { - std::string::size_type pos = libDir->find("-L"); - if((pos == std::string::npos || pos > 0) - && libDir->find("${") == std::string::npos) + std::string libpath = cmSystemTools::EscapeSpaces(libDir->c_str()); + if(libpath != "/usr/lib") { - linkLibs += "-L"; + std::string::size_type pos = libDir->find("-L"); + if((pos == std::string::npos || pos > 0) + && libDir->find("${") == std::string::npos) + { + linkLibs += "-L"; + } + linkLibs += libpath; + linkLibs += " "; } - linkLibs += cmSystemTools::EscapeSpaces(libDir->c_str()); - linkLibs += " "; } std::string librariesLinked; const cmTarget::LinkLibraries& libs = tgt.GetLinkLibraries(); @@ -273,9 +277,13 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout, std::string dir, file; cmSystemTools::SplitProgramPath(lib->first.c_str(), dir, file); - linkLibs += "-L"; - linkLibs += cmSystemTools::EscapeSpaces(dir.c_str()); - linkLibs += " "; + std::string libpath = cmSystemTools::EscapeSpaces(dir.c_str()); + if(libpath != "/usr/lib") + { + linkLibs += "-L"; + linkLibs += libpath; + linkLibs += " "; + } librariesLinked += "-l"; cmRegularExpression libname("lib(.*)\\.(.*)"); if(libname.find(file)) |