mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-09 22:04:10 +00:00
Eliminate useless duplicate libraries
llvm-svn: 5823
This commit is contained in:
parent
8b99be746e
commit
e3fca9bc04
@ -120,7 +120,8 @@ static inline bool LoadLibraryFromDirectory(const std::string &LibName,
|
||||
bool &isArchive) {
|
||||
if (FileExists(Directory + "lib" + LibName + ".a")) {
|
||||
std::string ErrorMessage;
|
||||
if (Verbose) std::cerr << "Loading '" << Directory << LibName << ".a'\n";
|
||||
if (Verbose) std::cerr << " Loading '" << Directory << "lib"
|
||||
<< LibName << ".a'\n";
|
||||
if (!ReadArchiveFile(Directory + "lib" + LibName + ".a", Objects,
|
||||
&ErrorMessage)) { // Read the archive file
|
||||
isArchive = true;
|
||||
@ -128,7 +129,7 @@ static inline bool LoadLibraryFromDirectory(const std::string &LibName,
|
||||
}
|
||||
|
||||
if (Verbose) {
|
||||
std::cerr << "Error loading archive '" + Directory + "lib"+LibName+".a'";
|
||||
std::cerr << " Error loading archive '" + Directory +"lib"+LibName+".a'";
|
||||
if (!ErrorMessage.empty()) std::cerr << ": " << ErrorMessage;
|
||||
std::cerr << "\n";
|
||||
}
|
||||
@ -305,6 +306,10 @@ int main(int argc, char **argv) {
|
||||
": error linking in '" + InputFilenames[i] + "'");
|
||||
}
|
||||
|
||||
// Remove any consecutive duplicates of the same library...
|
||||
Libraries.erase(std::unique(Libraries.begin(), Libraries.end()),
|
||||
Libraries.end());
|
||||
|
||||
// Link in all of the libraries next...
|
||||
for (unsigned i = 0; i != Libraries.size(); ++i) {
|
||||
if (Verbose) std::cerr << "Linking in library: -l" << Libraries[i] << "\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user