BUG: make sure link directories are not duplicated
This commit is contained in:
parent
b0dd81e665
commit
ecbc720829
@ -539,11 +539,26 @@ void cmMakefile::AddLinkDirectory(const char* dir)
|
|||||||
// linear search results in n^2 behavior, but n won't be getting
|
// linear search results in n^2 behavior, but n won't be getting
|
||||||
// much bigger than 20. We cannot use a set because of order
|
// much bigger than 20. We cannot use a set because of order
|
||||||
// dependency of the link search path.
|
// dependency of the link search path.
|
||||||
|
|
||||||
|
// remove trailing slashes
|
||||||
|
if(dir && dir[strlen(dir)-1] == '/')
|
||||||
|
{
|
||||||
|
std::string newdir = dir;
|
||||||
|
newdir = newdir.substr(0, newdir.size()-1);
|
||||||
|
if(std::find(m_LinkDirectories.begin(),
|
||||||
|
m_LinkDirectories.end(), newdir.c_str()) == m_LinkDirectories.end())
|
||||||
|
{
|
||||||
|
m_LinkDirectories.push_back(newdir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if(std::find(m_LinkDirectories.begin(),
|
if(std::find(m_LinkDirectories.begin(),
|
||||||
m_LinkDirectories.end(), dir) == m_LinkDirectories.end())
|
m_LinkDirectories.end(), dir) == m_LinkDirectories.end())
|
||||||
{
|
{
|
||||||
m_LinkDirectories.push_back(dir);
|
m_LinkDirectories.push_back(dir);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmMakefile::AddSubDirectory(const char* sub)
|
void cmMakefile::AddSubDirectory(const char* sub)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user