ENH: When a full path to a library cannot be parsed, just add the whole path to the link line. If it isn't a valid path, the linker will complain.

This commit is contained in:
Brad King 2002-12-04 14:18:10 -05:00
parent 1e8914ada8
commit 6676286784
1 changed files with 9 additions and 0 deletions

View File

@ -555,6 +555,7 @@ void cmLocalUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
cmRegularExpression libname_noprefix("([^/]*)(\\.so|\\.lib|\\.dll|\\.sl|\\.a|\\.dylib).*"); cmRegularExpression libname_noprefix("([^/]*)(\\.so|\\.lib|\\.dll|\\.sl|\\.a|\\.dylib).*");
if(libname.find(file)) if(libname.find(file))
{ {
// Library had "lib" prefix.
librariesLinked += libLinkFlag; librariesLinked += libLinkFlag;
file = libname.match(1); file = libname.match(1);
librariesLinked += file; librariesLinked += file;
@ -566,6 +567,7 @@ void cmLocalUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
} }
else if(libname_noprefix.find(file)) else if(libname_noprefix.find(file))
{ {
// Library had no "lib" prefix.
librariesLinked += libLinkFlag; librariesLinked += libLinkFlag;
file = libname_noprefix.match(1); file = libname_noprefix.match(1);
librariesLinked += file; librariesLinked += file;
@ -575,6 +577,13 @@ void cmLocalUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
} }
librariesLinked += " "; librariesLinked += " ";
} }
else
{
// Error parsing the library name. Just use the full path.
// The linker will give an error if it is invalid.
librariesLinked += lib->first;
librariesLinked += " ";
}
} }
// not a full path, so add -l name // not a full path, so add -l name
else else