From 504d0c37550931fe606f8b74ea2b5740f0c8539e Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 5 Mar 2021 12:01:36 +0100 Subject: qmake: Delegate prefix deduction to QLibraryInfo Now, that qmake depends on QtCore, we can just ask QLibraryInfo for the prefix instead of calculating it from QT_CONFIGURE_RELATIVE_PREFIX_PATH. Remove that define. Change-Id: I14be298a9d08abf33299e4cdbac55e91af318397 Reviewed-by: Alexey Edelev Reviewed-by: Alexandru Croitor --- qmake/qmakelibraryinfo.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'qmake/qmakelibraryinfo.cpp') diff --git a/qmake/qmakelibraryinfo.cpp b/qmake/qmakelibraryinfo.cpp index 4a101ebb6c..b1d625b906 100644 --- a/qmake/qmakelibraryinfo.cpp +++ b/qmake/qmakelibraryinfo.cpp @@ -138,13 +138,6 @@ void QMakeLibraryInfo::sysrootify(QString &path) } } -QString QMakeLibraryInfo::getPrefix() -{ - const QString canonicalQMakePath = QFileInfo(binaryAbsLocation).canonicalPath(); - return QDir::cleanPath(canonicalQMakePath + QLatin1Char('/') - + QLatin1String(QT_CONFIGURE_RELATIVE_PREFIX_PATH)); -} - QString QMakeLibraryInfo::path(int loc) { QString ret = rawLocation(loc, QMakeLibraryInfo::FinalPaths); @@ -255,8 +248,8 @@ QString QMakeLibraryInfo::rawLocation(int loc, QMakeLibraryInfo::PathGroup group // will be built with a dummy path, thus the compile-time result of // strlen is meaningless. const char *volatile path = nullptr; - if (loc == QLibraryInfo::PrefixPath) { - ret = getPrefix(); + if (loc == QLibraryInfo::PrefixPath || loc == HostPrefixPath) { + ret = QLibraryInfo::path(QLibraryInfo::PrefixPath); } else if (unsigned(loc) <= sizeof(qt_configure_str_offsets) / sizeof(qt_configure_str_offsets[0])) { path = qt_configure_strs + qt_configure_str_offsets[loc - 1]; @@ -264,9 +257,6 @@ QString QMakeLibraryInfo::rawLocation(int loc, QMakeLibraryInfo::PathGroup group } else if (loc == QLibraryInfo::SettingsPath) { path = QT_CONFIGURE_SETTINGS_PATH; #endif - } else if (loc == HostPrefixPath) { - static const QByteArray hostPrefixPath = getPrefix().toLatin1(); - path = hostPrefixPath.constData(); } if (path) -- cgit v1.2.3