remove link_highest_lib_version misfeature

in retrospect, we were too conservative in 925fd32a2d making the
"feature" optional - it simply makes no sense to have qmake
automatically find the highest major (!) version of a library based on
a loosely defined platform-specific convention (not standard, unlike
ELF's .so versioning) with side effects.

Change-Id: Iba92df433b199a9fbff88358f6e0f6835f2e813d
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Oswald Buddenhagen 2015-06-01 20:04:22 +02:00
parent cbbeed519b
commit 5df87614e3
3 changed files with 4 additions and 24 deletions

View File

@ -82,7 +82,7 @@ bool MingwMakefileGenerator::findLibraries()
QString suffix = project->first(ProKey("QMAKE_" + steam.toUpper() + "_SUFFIX")).toQString();
for (QList<QMakeLocalFileName>::Iterator dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) {
QString extension;
int ver = findHighestVersion((*dir_it).local(), steam, "dll.a|a");
int ver = findHighestVersion((*dir_it).local(), steam);
if (ver > 0)
extension += QString::number(ver);
extension += suffix;

View File

@ -50,7 +50,7 @@ Win32MakefileGenerator::Win32MakefileGenerator() : MakefileGenerator()
}
int
Win32MakefileGenerator::findHighestVersion(const QString &d, const QString &stem, const QString &ext)
Win32MakefileGenerator::findHighestVersion(const QString &d, const QString &stem)
{
QString bd = Option::normalizePath(d);
if(!exists(bd))
@ -69,30 +69,10 @@ Win32MakefileGenerator::findHighestVersion(const QString &d, const QString &stem
return vover.first().toInt();
int biggest=-1;
if (project->isActiveConfig("link_highest_lib_version")) {
static QHash<QString, QStringList> dirEntryListCache;
QStringList entries = dirEntryListCache.value(bd);
if (entries.isEmpty()) {
QDir dir(bd);
entries = dir.entryList();
dirEntryListCache.insert(bd, entries);
}
QRegExp regx(QString("((lib)?%1([0-9]*)).(%2|prl)$").arg(stem).arg(ext), Qt::CaseInsensitive);
for(QStringList::Iterator it = entries.begin(); it != entries.end(); ++it) {
if(regx.exactMatch((*it))) {
if (!regx.cap(3).isEmpty()) {
bool ok = true;
int num = regx.cap(3).toInt(&ok);
biggest = qMax(biggest, (!ok ? -1 : num));
}
}
}
}
if(libInfoRead
&& !libinfo.values("QMAKE_PRL_CONFIG").contains("staticlib")
&& !libinfo.isEmpty("QMAKE_PRL_VERSION"))
biggest = qMax(biggest, libinfo.first("QMAKE_PRL_VERSION").toQString().replace(".", "").toInt());
biggest = libinfo.first("QMAKE_PRL_VERSION").toQString().replace(".", "").toInt();
return biggest;
}

View File

@ -57,7 +57,7 @@ protected:
virtual void writeRcFilePart(QTextStream &t);
int findHighestVersion(const QString &dir, const QString &stem, const QString &ext = QLatin1String("lib"));
int findHighestVersion(const QString &dir, const QString &stem);
virtual bool findLibraries();
virtual ProString fixLibFlag(const ProString &lib);