From 2a9c93a3483e60257d2625b70b395cc20dcc88ce Mon Sep 17 00:00:00 2001 From: Yang Yuyin Date: Wed, 10 Mar 2021 09:41:15 +0800 Subject: [PATCH 01/10] QIcon::setIsMask: delete extra judgment QIcon::detach can judgment if the d pointer is nullptr Pick-to: 6.1 Change-Id: I90fd5f50ed2565a5654b978c4603635e62677953 Reviewed-by: David Skoland Reviewed-by: Eirik Aavitsland --- src/gui/image/qicon.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index d3fe8791b7b..2b607ac5be7 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -1377,8 +1377,7 @@ bool QIcon::hasThemeIcon(const QString &name) */ void QIcon::setIsMask(bool isMask) { - if (d) - detach(); + detach(); if (!d) d = new QIconPrivate(new QPixmapIconEngine); d->is_mask = isMask; From 17055f5f4833ba96f7d361c7113a88d973a0e186 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 5 Mar 2021 11:19:16 +0100 Subject: [PATCH 02/10] Remove the platformsSection constant from qconfig.cpp.in This is not configurable and doesn't have to be in the generated q[make]config.cpp files. Change-Id: If294d735800a3b5c6b3e269abdd86df401cf4864 Reviewed-by: Alexey Edelev Reviewed-by: Alexandru Croitor --- qmake/qmakelibraryinfo.cpp | 2 +- src/corelib/global/qconfig.cpp.in | 2 -- src/corelib/global/qlibraryinfo.cpp | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/qmake/qmakelibraryinfo.cpp b/qmake/qmakelibraryinfo.cpp index e8bb70071ed..c118725d272 100644 --- a/qmake/qmakelibraryinfo.cpp +++ b/qmake/qmakelibraryinfo.cpp @@ -110,7 +110,7 @@ void QMakeLibrarySettings::load() haveEffectiveSourcePaths || children.contains(QLatin1String("EffectivePaths")); // Backwards compat: an existing but empty file is claimed to contain the Paths section. havePaths = (!haveDevicePaths && !haveEffectivePaths - && !children.contains(QLatin1String(platformsSection))) + && !children.contains(QLatin1String("Platforms"))) || children.contains(QLatin1String("Paths")); } else { haveDevicePaths = false; diff --git a/src/corelib/global/qconfig.cpp.in b/src/corelib/global/qconfig.cpp.in index b529e198305..0eced515cf4 100644 --- a/src/corelib/global/qconfig.cpp.in +++ b/src/corelib/global/qconfig.cpp.in @@ -98,5 +98,3 @@ static const struct { { "HostPrefix", "" }, #endif }; - -static const char platformsSection[] = "Platforms"; diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index b48b1b5d955..f6c755b750d 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -122,7 +122,7 @@ void QLibrarySettings::load() haveEffectivePaths = haveEffectiveSourcePaths || children.contains(QLatin1String("EffectivePaths")); // Backwards compat: an existing but empty file is claimed to contain the Paths section. havePaths = (!haveDevicePaths && !haveEffectivePaths - && !children.contains(QLatin1String(platformsSection))) + && !children.contains(QLatin1String("Platforms"))) || children.contains(QLatin1String("Paths")); if (!havePaths) settings.reset(nullptr); @@ -594,7 +594,7 @@ QStringList QLibraryInfo::platformPluginArguments(const QString &platformName) #if QT_CONFIG(settings) QScopedPointer settings(QLibraryInfoPrivate::findConfiguration()); if (!settings.isNull()) { - const QString key = QLatin1String(platformsSection) + const QString key = QLatin1String("Platforms") + QLatin1Char('/') + platformName + QLatin1String("Arguments"); From b788c87457100dfaa92f77d24f3d7fab4798ab6b Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 5 Mar 2021 12:36:10 +0100 Subject: [PATCH 03/10] QMakeLibraryInfo: Move reading of default values into separate function Reduce code duplication. Change-Id: Ic20c124ad664d16552e3cfea8dde465fc0b6066f Reviewed-by: Alexey Edelev Reviewed-by: Alexandru Croitor --- qmake/qmakelibraryinfo.cpp | 52 +++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/qmake/qmakelibraryinfo.cpp b/qmake/qmakelibraryinfo.cpp index c118725d272..4a101ebb6c7 100644 --- a/qmake/qmakelibraryinfo.cpp +++ b/qmake/qmakelibraryinfo.cpp @@ -156,6 +156,28 @@ QString QMakeLibraryInfo::path(int loc) return ret; } +struct LocationInfo +{ + QString key; + QString defaultValue; +}; + +static LocationInfo defaultLocationInfo(int loc) +{ + LocationInfo result; + if (unsigned(loc) < sizeof(qtConfEntries) / sizeof(qtConfEntries[0])) { + result.key = QLatin1String(qtConfEntries[loc].key); + result.defaultValue = QLatin1String(qtConfEntries[loc].value); + } +#ifndef Q_OS_WIN // On Windows we use the registry + else if (loc == QLibraryInfo::SettingsPath) { + result.key = QLatin1String("Settings"); + result.defaultValue = QLatin1String("."); + } +#endif + return result; +} + QString QMakeLibraryInfo::rawLocation(int loc, QMakeLibraryInfo::PathGroup group) { QString ret; @@ -175,19 +197,8 @@ QString QMakeLibraryInfo::rawLocation(int loc, QMakeLibraryInfo::PathGroup group || (group = orig_group, false)) { fromConf = true; - QString key; - QString defaultValue; - if (unsigned(loc) < sizeof(qtConfEntries) / sizeof(qtConfEntries[0])) { - key = QLatin1String(qtConfEntries[loc].key); - defaultValue = QLatin1String(qtConfEntries[loc].value); - } -#ifndef Q_OS_WIN // On Windows we use the registry - else if (loc == QLibraryInfo::SettingsPath) { - key = QLatin1String("Settings"); - defaultValue = QLatin1String("."); - } -#endif - if (!key.isNull()) { + LocationInfo locinfo = defaultLocationInfo(loc); + if (!locinfo.key.isNull()) { QSettings *config = QMakeLibraryInfo::configuration(); config->beginGroup(QLatin1String(group == DevicePaths ? "DevicePaths" : group == EffectiveSourcePaths @@ -195,17 +206,16 @@ QString QMakeLibraryInfo::rawLocation(int loc, QMakeLibraryInfo::PathGroup group : group == EffectivePaths ? "EffectivePaths" : "Paths")); - ret = config->value(key, defaultValue).toString(); + ret = config->value(locinfo.key, locinfo.defaultValue).toString(); if (ret.isEmpty()) { - if (loc == HostPrefixPath) - ret = config->value(QLatin1String(qtConfEntries[QLibraryInfo::PrefixPath].key), - QLatin1String( - qtConfEntries[QLibraryInfo::PrefixPath].value)) - .toString(); - else if (loc == TargetSpecPath || loc == HostSpecPath - || loc == SysrootifyPrefixPath) + if (loc == HostPrefixPath) { + locinfo = defaultLocationInfo(QLibraryInfo::PrefixPath); + ret = config->value(locinfo.key, locinfo.defaultValue).toString(); + } else if (loc == TargetSpecPath || loc == HostSpecPath + || loc == SysrootifyPrefixPath) { fromConf = false; + } // The last case here is SysrootPath, which can be legitimately empty. // All other keys have non-empty fallbacks to start with. } From 504d0c37550931fe606f8b74ea2b5740f0c8539e Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 5 Mar 2021 12:01:36 +0100 Subject: [PATCH 04/10] 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/CMakeLists.txt | 9 --------- qmake/qmakelibraryinfo.cpp | 14 ++------------ qmake/qmakelibraryinfo.h | 1 - 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index 2a46a6f3c83..2eca639576b 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -12,14 +12,6 @@ if(NOT QT_FEATURE_qmake) return() endif() -# The QT_CONFIGURE_HOSTBINDIR_TO_*PREFIX_PATH defines are exclusively used by qmake to determine -# the prefix from the location of the qmake executable. In our build of qmake host_prefix is -# always the same as ext_prefix, and we can just use CMAKE_INSTALL_PREFIX for the calculation of -# the relative path between /bin and . -file(RELATIVE_PATH QT_CONFIGURE_RELATIVE_PREFIX_PATH - "${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR}" "${CMAKE_INSTALL_PREFIX}" -) - qt_get_tool_target_name(target_name qmake) qt_internal_add_tool(${target_name} TOOLS_TARGET Core # special case @@ -65,7 +57,6 @@ qt_internal_add_tool(${target_name} QT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} # special case QT_VERSION_MINOR=${PROJECT_VERSION_MINOR} # special case QT_VERSION_PATCH=${PROJECT_VERSION_PATCH} # special case - QT_CONFIGURE_RELATIVE_PREFIX_PATH="${QT_CONFIGURE_RELATIVE_PREFIX_PATH}" INCLUDE_DIRECTORIES generators generators/mac diff --git a/qmake/qmakelibraryinfo.cpp b/qmake/qmakelibraryinfo.cpp index 4a101ebb6c7..b1d625b9066 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) diff --git a/qmake/qmakelibraryinfo.h b/qmake/qmakelibraryinfo.h index a1983951277..394d5d51b96 100644 --- a/qmake/qmakelibraryinfo.h +++ b/qmake/qmakelibraryinfo.h @@ -80,7 +80,6 @@ struct QMakeLibraryInfo static QString qtconfManualPath; private: - static QString getPrefix(); static QString libraryInfoFile(); }; From c651e7ba18e094a0cb7bd46ea5ec6cad49ca3220 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 5 Mar 2021 16:33:24 +0100 Subject: [PATCH 05/10] Do not write Sysroot and SysrootifyPrefix into qmakeconfig.cpp Those have fixed values. Change-Id: I7f1ba8036f43413d3c805f4b419ae79e037343fb Reviewed-by: Alexey Edelev Reviewed-by: Alexandru Croitor --- cmake/QtQmakeHelpers.cmake | 2 - qmake/qmakelibraryinfo.cpp | 65 +++++++++++++++++++------------ qmake/qmakelibraryinfo.h | 9 +++-- src/corelib/global/qconfig.cpp.in | 4 +- 4 files changed, 48 insertions(+), 32 deletions(-) diff --git a/cmake/QtQmakeHelpers.cmake b/cmake/QtQmakeHelpers.cmake index fcfee7c3018..d1cd17f7cad 100644 --- a/cmake/QtQmakeHelpers.cmake +++ b/cmake/QtQmakeHelpers.cmake @@ -53,8 +53,6 @@ function(qt_generate_qconfig_cpp in_file out_file) set(QT_CONFIG_STR_OFFSETS "") set(QT_CONFIG_STRS "") - qt_add_string_to_qconfig_cpp("") # config.input.sysroot - qt_add_string_to_qconfig_cpp("false") # qmake_sysrootify qt_add_string_to_qconfig_cpp("${INSTALL_BINDIR}") qt_add_string_to_qconfig_cpp("${INSTALL_LIBEXECDIR}") qt_add_string_to_qconfig_cpp("${INSTALL_LIBDIR}") diff --git a/qmake/qmakelibraryinfo.cpp b/qmake/qmakelibraryinfo.cpp index b1d625b9066..937f0811ddc 100644 --- a/qmake/qmakelibraryinfo.cpp +++ b/qmake/qmakelibraryinfo.cpp @@ -143,7 +143,7 @@ QString QMakeLibraryInfo::path(int loc) QString ret = rawLocation(loc, QMakeLibraryInfo::FinalPaths); // Automatically prepend the sysroot to target paths - if (loc < QMakeLibraryInfo::SysrootPath || loc > QMakeLibraryInfo::LastHostPath) + if (loc < QMakeLibraryInfo::FirstHostPath || loc > QMakeLibraryInfo::LastHostPath) sysrootify(ret); return ret; @@ -158,7 +158,12 @@ struct LocationInfo static LocationInfo defaultLocationInfo(int loc) { LocationInfo result; - if (unsigned(loc) < sizeof(qtConfEntries) / sizeof(qtConfEntries[0])) { + + if (loc == QMakeLibraryInfo::SysrootPath) { + result.key = QStringLiteral("Sysroot"); + } else if (loc == QMakeLibraryInfo::SysrootifyPrefixPath) { + result.key = QStringLiteral("SysrootifyPrefix"); + } else if (unsigned(loc) < sizeof(qtConfEntries) / sizeof(qtConfEntries[0])) { result.key = QLatin1String(qtConfEntries[loc].key); result.defaultValue = QLatin1String(qtConfEntries[loc].value); } @@ -171,6 +176,37 @@ static LocationInfo defaultLocationInfo(int loc) return result; } +static QString storedPath(int loc) +{ + QString result; + + // "volatile" here is a hack to prevent compilers from doing a + // compile-time strlen() on "path". The issue is that Qt installers + // will binary-patch the Qt installation paths -- in such scenarios, Qt + // 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 || loc == QMakeLibraryInfo::HostPrefixPath) { + result = QLibraryInfo::path(QLibraryInfo::PrefixPath); + } else if (loc == QMakeLibraryInfo::SysrootPath) { + // empty result + } else if (loc == QMakeLibraryInfo::SysrootifyPrefixPath) { + result = QStringLiteral("false"); + } 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]; +#ifndef Q_OS_WIN // On Windows we use the registry + } else if (loc == QLibraryInfo::SettingsPath) { + path = QT_CONFIGURE_SETTINGS_PATH; +#endif + } + + if (path) + result = QString::fromLocal8Bit(path); + + return result; +} + QString QMakeLibraryInfo::rawLocation(int loc, QMakeLibraryInfo::PathGroup group) { QString ret; @@ -241,27 +277,8 @@ QString QMakeLibraryInfo::rawLocation(int loc, QMakeLibraryInfo::PathGroup group } } - if (!fromConf) { - // "volatile" here is a hack to prevent compilers from doing a - // compile-time strlen() on "path". The issue is that Qt installers - // will binary-patch the Qt installation paths -- in such scenarios, Qt - // 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 || 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]; -#ifndef Q_OS_WIN // On Windows we use the registry - } else if (loc == QLibraryInfo::SettingsPath) { - path = QT_CONFIGURE_SETTINGS_PATH; -#endif - } - - if (path) - ret = QString::fromLocal8Bit(path); - } + if (!fromConf) + ret = storedPath(loc); // These values aren't actually paths and thus need to be returned verbatim. if (loc == TargetSpecPath || loc == HostSpecPath || loc == SysrootifyPrefixPath) @@ -274,7 +291,7 @@ QString QMakeLibraryInfo::rawLocation(int loc, QMakeLibraryInfo::PathGroup group // loc == PrefixPath while a sysroot is set would make no sense here. // loc == SysrootPath only makes sense if qmake lives inside the sysroot itself. baseDir = QFileInfo(libraryInfoFile()).absolutePath(); - } else if (loc > SysrootPath && loc <= LastHostPath) { + } else if (loc >= FirstHostPath && loc <= LastHostPath) { // We make any other host path absolute to the host prefix directory. baseDir = rawLocation(HostPrefixPath, group); } else { diff --git a/qmake/qmakelibraryinfo.h b/qmake/qmakelibraryinfo.h index 394d5d51b96..8d9f1455e61 100644 --- a/qmake/qmakelibraryinfo.h +++ b/qmake/qmakelibraryinfo.h @@ -59,16 +59,17 @@ struct QMakeLibraryInfo * See qconfig.cpp.in and QLibraryInfo for details. */ enum LibraryPathQMakeExtras { - SysrootPath = QLibraryInfo::TestsPath + 1, - SysrootifyPrefixPath, - HostBinariesPath, + HostBinariesPath = QLibraryInfo::TestsPath + 1, + FirstHostPath = HostBinariesPath, HostLibraryExecutablesPath, HostLibrariesPath, HostDataPath, TargetSpecPath, HostSpecPath, HostPrefixPath, - LastHostPath = HostPrefixPath, + SysrootPath, + SysrootifyPrefixPath, + LastHostPath = SysrootifyPrefixPath }; enum PathGroup { FinalPaths, EffectivePaths, EffectiveSourcePaths, DevicePaths }; static QString rawLocation(int loc, PathGroup group); diff --git a/src/corelib/global/qconfig.cpp.in b/src/corelib/global/qconfig.cpp.in index 0eced515cf4..161ae0b6cdd 100644 --- a/src/corelib/global/qconfig.cpp.in +++ b/src/corelib/global/qconfig.cpp.in @@ -83,8 +83,6 @@ static const struct { { "Tests", "tests" }, // Put new entries above this line ONLY! #ifdef QT_BUILD_QMAKE - { "Sysroot", "" }, - { "SysrootifyPrefix", "" }, { "HostBinaries", "bin" }, #ifdef Q_OS_WIN { "HostLibraryExecutables", "bin" }, @@ -96,5 +94,7 @@ static const struct { { "TargetSpec", "" }, { "HostSpec", "" }, { "HostPrefix", "" }, + { "Sysroot", "" }, + { "SysrootifyPrefix", "" }, #endif }; From 3c12ab974ffa7aa51ca157989997f6e10c1c2259 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 5 Mar 2021 17:16:35 +0100 Subject: [PATCH 06/10] Pass target and host mkspec as defines to QMakeLibraryInfo Change-Id: If07055286496c507310c0dbb3a06f1a42d643596 Reviewed-by: Alexey Edelev Reviewed-by: Alexandru Croitor --- cmake/QtQmakeHelpers.cmake | 2 -- qmake/CMakeLists.txt | 2 ++ qmake/qmakelibraryinfo.cpp | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cmake/QtQmakeHelpers.cmake b/cmake/QtQmakeHelpers.cmake index d1cd17f7cad..02e60ac3825 100644 --- a/cmake/QtQmakeHelpers.cmake +++ b/cmake/QtQmakeHelpers.cmake @@ -57,8 +57,6 @@ function(qt_generate_qconfig_cpp in_file out_file) qt_add_string_to_qconfig_cpp("${INSTALL_LIBEXECDIR}") qt_add_string_to_qconfig_cpp("${INSTALL_LIBDIR}") qt_add_string_to_qconfig_cpp("${hostdatadir}") - qt_add_string_to_qconfig_cpp("${QT_QMAKE_TARGET_MKSPEC}") - qt_add_string_to_qconfig_cpp("${QT_QMAKE_HOST_MKSPEC}") # Save second part. set(QT_CONFIG_STR_OFFSETS_SECOND "${QT_CONFIG_STR_OFFSETS}") diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index 2eca639576b..fff80b6b191 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -57,6 +57,8 @@ qt_internal_add_tool(${target_name} QT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} # special case QT_VERSION_MINOR=${PROJECT_VERSION_MINOR} # special case QT_VERSION_PATCH=${PROJECT_VERSION_PATCH} # special case + QT_HOST_MKSPEC="${QT_QMAKE_HOST_MKSPEC}" + QT_TARGET_MKSPEC="${QT_QMAKE_TARGET_MKSPEC}" INCLUDE_DIRECTORIES generators generators/mac diff --git a/qmake/qmakelibraryinfo.cpp b/qmake/qmakelibraryinfo.cpp index 937f0811ddc..365e72e0fc2 100644 --- a/qmake/qmakelibraryinfo.cpp +++ b/qmake/qmakelibraryinfo.cpp @@ -163,6 +163,10 @@ static LocationInfo defaultLocationInfo(int loc) result.key = QStringLiteral("Sysroot"); } else if (loc == QMakeLibraryInfo::SysrootifyPrefixPath) { result.key = QStringLiteral("SysrootifyPrefix"); + } else if (loc == QMakeLibraryInfo::TargetSpecPath) { + result.key = QStringLiteral("TargetSpec"); + } else if (loc == QMakeLibraryInfo::HostSpecPath) { + result.key = QStringLiteral("HostSpec"); } else if (unsigned(loc) < sizeof(qtConfEntries) / sizeof(qtConfEntries[0])) { result.key = QLatin1String(qtConfEntries[loc].key); result.defaultValue = QLatin1String(qtConfEntries[loc].value); @@ -192,6 +196,10 @@ static QString storedPath(int loc) // empty result } else if (loc == QMakeLibraryInfo::SysrootifyPrefixPath) { result = QStringLiteral("false"); + } else if (loc == QMakeLibraryInfo::TargetSpecPath) { + result = QT_TARGET_MKSPEC; + } else if (loc == QMakeLibraryInfo::HostSpecPath) { + result = QT_HOST_MKSPEC; } 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]; From a08b1f63595f61e7fa12b04d516ec20396906c9e Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 5 Mar 2021 18:12:31 +0100 Subject: [PATCH 07/10] Read QLibraryInfo paths directly from QLibraryInfo and not from qmakeconfig.cpp Change-Id: I1db1c871ec6b4e572bd36df6aff7a5be8a4a706c Reviewed-by: Alexey Edelev Reviewed-by: Alexandru Croitor --- qmake/qmakelibraryinfo.cpp | 24 ++++++++++------------ qmake/qmakelibraryinfo.h | 6 +++--- src/corelib/global/qconfig.cpp.in | 2 +- src/corelib/global/qlibraryinfo.cpp | 31 +++++++++++++++++++---------- 4 files changed, 35 insertions(+), 28 deletions(-) diff --git a/qmake/qmakelibraryinfo.cpp b/qmake/qmakelibraryinfo.cpp index 365e72e0fc2..c8461c1d75b 100644 --- a/qmake/qmakelibraryinfo.cpp +++ b/qmake/qmakelibraryinfo.cpp @@ -143,12 +143,15 @@ QString QMakeLibraryInfo::path(int loc) QString ret = rawLocation(loc, QMakeLibraryInfo::FinalPaths); // Automatically prepend the sysroot to target paths - if (loc < QMakeLibraryInfo::FirstHostPath || loc > QMakeLibraryInfo::LastHostPath) + if (loc < QMakeLibraryInfo::FirstHostPath) sysrootify(ret); return ret; } +// from qlibraryinfo.cpp: +void qlibraryinfo_keyAndDefault(QLibraryInfo::LibraryPath loc, QString *key, QString *value); + struct LocationInfo { QString key; @@ -159,7 +162,10 @@ static LocationInfo defaultLocationInfo(int loc) { LocationInfo result; - if (loc == QMakeLibraryInfo::SysrootPath) { + if (loc < QMakeLibraryInfo::FirstHostPath) { + qlibraryinfo_keyAndDefault(static_cast(loc), + &result.key, &result.defaultValue); + } else if (loc == QMakeLibraryInfo::SysrootPath) { result.key = QStringLiteral("Sysroot"); } else if (loc == QMakeLibraryInfo::SysrootifyPrefixPath) { result.key = QStringLiteral("SysrootifyPrefix"); @@ -171,12 +177,6 @@ static LocationInfo defaultLocationInfo(int loc) result.key = QLatin1String(qtConfEntries[loc].key); result.defaultValue = QLatin1String(qtConfEntries[loc].value); } -#ifndef Q_OS_WIN // On Windows we use the registry - else if (loc == QLibraryInfo::SettingsPath) { - result.key = QLatin1String("Settings"); - result.defaultValue = QLatin1String("."); - } -#endif return result; } @@ -190,7 +190,9 @@ static QString storedPath(int loc) // 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 || loc == QMakeLibraryInfo::HostPrefixPath) { + if (loc < QMakeLibraryInfo::FirstHostPath) { + result = QLibraryInfo::path(static_cast(loc)); + } else if (loc == QMakeLibraryInfo::HostPrefixPath) { result = QLibraryInfo::path(QLibraryInfo::PrefixPath); } else if (loc == QMakeLibraryInfo::SysrootPath) { // empty result @@ -203,10 +205,6 @@ static QString storedPath(int loc) } 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]; -#ifndef Q_OS_WIN // On Windows we use the registry - } else if (loc == QLibraryInfo::SettingsPath) { - path = QT_CONFIGURE_SETTINGS_PATH; -#endif } if (path) diff --git a/qmake/qmakelibraryinfo.h b/qmake/qmakelibraryinfo.h index 8d9f1455e61..bf1bae81d8e 100644 --- a/qmake/qmakelibraryinfo.h +++ b/qmake/qmakelibraryinfo.h @@ -64,12 +64,12 @@ struct QMakeLibraryInfo HostLibraryExecutablesPath, HostLibrariesPath, HostDataPath, + HostPrefixPath, + LastHostPath = HostPrefixPath, TargetSpecPath, HostSpecPath, - HostPrefixPath, SysrootPath, - SysrootifyPrefixPath, - LastHostPath = SysrootifyPrefixPath + SysrootifyPrefixPath }; enum PathGroup { FinalPaths, EffectivePaths, EffectiveSourcePaths, DevicePaths }; static QString rawLocation(int loc, PathGroup group); diff --git a/src/corelib/global/qconfig.cpp.in b/src/corelib/global/qconfig.cpp.in index 161ae0b6cdd..e27f3c3e693 100644 --- a/src/corelib/global/qconfig.cpp.in +++ b/src/corelib/global/qconfig.cpp.in @@ -91,9 +91,9 @@ static const struct { #endif { "HostLibraries", "lib" }, { "HostData", "." }, + { "HostPrefix", "" }, { "TargetSpec", "" }, { "HostSpec", "" }, - { "HostPrefix", "" }, { "Sysroot", "" }, { "SysrootifyPrefix", "" }, #endif diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index f6c755b750d..0bd6674b43d 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -476,6 +476,25 @@ static QString getPrefix() #endif } +Q_CORE_EXPORT void qlibraryinfo_keyAndDefault(QLibraryInfo::LibraryPath loc, QString *key, + QString *value) +{ + if (unsigned(loc) < sizeof(qtConfEntries)/sizeof(qtConfEntries[0])) { + *key = QLatin1String(qtConfEntries[loc].key); + *value = QLatin1String(qtConfEntries[loc].value); + } +#ifndef Q_OS_WIN // On Windows we use the registry + else if (loc == QLibraryInfo::SettingsPath) { + *key = QLatin1String("Settings"); + *value = QLatin1String("."); + } +#endif + else { + key->clear(); + value->clear(); + } +} + /*! \fn QString QLibraryInfo::location(LibraryLocation loc) \obsolete Use path() instead. @@ -499,17 +518,7 @@ QString QLibraryInfo::path(LibraryPath p) QString key; QString defaultValue; - if (unsigned(loc) < sizeof(qtConfEntries)/sizeof(qtConfEntries[0])) { - key = QLatin1String(qtConfEntries[loc].key); - defaultValue = QLatin1String(qtConfEntries[loc].value); - } -#ifndef Q_OS_WIN // On Windows we use the registry - else if (loc == SettingsPath) { - key = QLatin1String("Settings"); - defaultValue = QLatin1String("."); - } -#endif - + qlibraryinfo_keyAndDefault(loc, &key, &defaultValue); if (!key.isNull()) { QSettings *config = QLibraryInfoPrivate::configuration(); config->beginGroup(QLatin1String("Paths")); From 9f5a7cb5fa5630db484891c50fc3409871bc3d8a Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 5 Mar 2021 21:57:51 +0100 Subject: [PATCH 08/10] qmake: Do not read from qmakeconfig.cpp Change-Id: I6a46c2e817f8dc3f580774aba2db8bfb01f5a403 Reviewed-by: Alexandru Croitor --- qmake/qmakelibraryinfo.cpp | 42 +++++++++++++++++++++----------------- qmake/qmakelibraryinfo.h | 2 ++ 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/qmake/qmakelibraryinfo.cpp b/qmake/qmakelibraryinfo.cpp index c8461c1d75b..4edff1142a5 100644 --- a/qmake/qmakelibraryinfo.cpp +++ b/qmake/qmakelibraryinfo.cpp @@ -49,6 +49,8 @@ #include +#include + QT_BEGIN_NAMESPACE QString QMakeLibraryInfo::binaryAbsLocation; @@ -149,6 +151,22 @@ QString QMakeLibraryInfo::path(int loc) return ret; } +static QLibraryInfo::LibraryPath hostToTargetPathEnum(int loc) +{ + static std::pair mapping[] = { + { QMakeLibraryInfo::HostBinariesPath, QLibraryInfo::BinariesPath }, + { QMakeLibraryInfo::HostLibraryExecutablesPath, QLibraryInfo::LibraryExecutablesPath }, + { QMakeLibraryInfo::HostLibrariesPath, QLibraryInfo::LibrariesPath }, + { QMakeLibraryInfo::HostDataPath, QLibraryInfo::DataPath }, + { QMakeLibraryInfo::HostPrefixPath, QLibraryInfo::PrefixPath } + }; + for (size_t i = 0; i < sizeof(mapping) / sizeof(mapping[0]); ++i) { + if (mapping[i].first == loc) + return mapping[i].second; + } + qFatal("Unhandled host path %d in hostToTargetPathEnum.", loc); +} + // from qlibraryinfo.cpp: void qlibraryinfo_keyAndDefault(QLibraryInfo::LibraryPath loc, QString *key, QString *value); @@ -165,6 +183,9 @@ static LocationInfo defaultLocationInfo(int loc) if (loc < QMakeLibraryInfo::FirstHostPath) { qlibraryinfo_keyAndDefault(static_cast(loc), &result.key, &result.defaultValue); + } else if (loc <= QMakeLibraryInfo::LastHostPath) { + qlibraryinfo_keyAndDefault(hostToTargetPathEnum(loc), &result.key, &result.defaultValue); + result.key.prepend(QStringLiteral("Host")); } else if (loc == QMakeLibraryInfo::SysrootPath) { result.key = QStringLiteral("Sysroot"); } else if (loc == QMakeLibraryInfo::SysrootifyPrefixPath) { @@ -173,9 +194,6 @@ static LocationInfo defaultLocationInfo(int loc) result.key = QStringLiteral("TargetSpec"); } else if (loc == QMakeLibraryInfo::HostSpecPath) { result.key = QStringLiteral("HostSpec"); - } else if (unsigned(loc) < sizeof(qtConfEntries) / sizeof(qtConfEntries[0])) { - result.key = QLatin1String(qtConfEntries[loc].key); - result.defaultValue = QLatin1String(qtConfEntries[loc].value); } return result; } @@ -183,17 +201,10 @@ static LocationInfo defaultLocationInfo(int loc) static QString storedPath(int loc) { QString result; - - // "volatile" here is a hack to prevent compilers from doing a - // compile-time strlen() on "path". The issue is that Qt installers - // will binary-patch the Qt installation paths -- in such scenarios, Qt - // will be built with a dummy path, thus the compile-time result of - // strlen is meaningless. - const char *volatile path = nullptr; if (loc < QMakeLibraryInfo::FirstHostPath) { result = QLibraryInfo::path(static_cast(loc)); - } else if (loc == QMakeLibraryInfo::HostPrefixPath) { - result = QLibraryInfo::path(QLibraryInfo::PrefixPath); + } else if (loc <= QMakeLibraryInfo::LastHostPath) { + result = QLibraryInfo::path(hostToTargetPathEnum(loc)); } else if (loc == QMakeLibraryInfo::SysrootPath) { // empty result } else if (loc == QMakeLibraryInfo::SysrootifyPrefixPath) { @@ -202,14 +213,7 @@ static QString storedPath(int loc) result = QT_TARGET_MKSPEC; } else if (loc == QMakeLibraryInfo::HostSpecPath) { result = QT_HOST_MKSPEC; - } 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]; } - - if (path) - result = QString::fromLocal8Bit(path); - return result; } diff --git a/qmake/qmakelibraryinfo.h b/qmake/qmakelibraryinfo.h index bf1bae81d8e..896181493c2 100644 --- a/qmake/qmakelibraryinfo.h +++ b/qmake/qmakelibraryinfo.h @@ -57,6 +57,8 @@ struct QMakeLibraryInfo /* This enum has to start after the last value in QLibraryInfo::LibraryPath(NOT SettingsPath!). * See qconfig.cpp.in and QLibraryInfo for details. + * When adding enum values between FirstHostPath and LastHostPath, make sure to adjust + * the hostToTargetPathEnum(int) function. */ enum LibraryPathQMakeExtras { HostBinariesPath = QLibraryInfo::TestsPath + 1, From e158d699e0b044dbe4849f756c2dca92d05747e8 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 5 Mar 2021 22:09:04 +0100 Subject: [PATCH 09/10] Remove all qmake-related data from q[make]config.cpp Now that we're not actually using qmakeconfig.cpp anymore, we can remove it together with all qmake-related information that was written into qconfig.cpp. This also moves the qtConfEntries array back to qlibraryinfo.cpp. Change-Id: I5e57d8c55613332cc3e57b11df4398d46aed259b Reviewed-by: Alexey Edelev Reviewed-by: Alexandru Croitor --- cmake/QtQmakeHelpers.cmake | 13 ----- qmake/CMakeLists.txt | 3 - qmake/qmakelibraryinfo.cpp | 2 - src/corelib/global/qconfig.cpp.in | 85 ++--------------------------- src/corelib/global/qlibraryinfo.cpp | 29 ++++++++++ 5 files changed, 34 insertions(+), 98 deletions(-) diff --git a/cmake/QtQmakeHelpers.cmake b/cmake/QtQmakeHelpers.cmake index 02e60ac3825..f64032a77de 100644 --- a/cmake/QtQmakeHelpers.cmake +++ b/cmake/QtQmakeHelpers.cmake @@ -49,19 +49,6 @@ function(qt_generate_qconfig_cpp in_file out_file) set(QT_CONFIG_STR_OFFSETS_FIRST "${QT_CONFIG_STR_OFFSETS}") set(QT_CONFIG_STRS_FIRST "${QT_CONFIG_STRS}") - # Start second part. - set(QT_CONFIG_STR_OFFSETS "") - set(QT_CONFIG_STRS "") - - qt_add_string_to_qconfig_cpp("${INSTALL_BINDIR}") - qt_add_string_to_qconfig_cpp("${INSTALL_LIBEXECDIR}") - qt_add_string_to_qconfig_cpp("${INSTALL_LIBDIR}") - qt_add_string_to_qconfig_cpp("${hostdatadir}") - - # Save second part. - set(QT_CONFIG_STR_OFFSETS_SECOND "${QT_CONFIG_STR_OFFSETS}") - set(QT_CONFIG_STRS_SECOND "${QT_CONFIG_STRS}") - # Settings path / sysconf dir. set(QT_SYS_CONF_DIR "${INSTALL_SYSCONFDIR}") diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index fff80b6b191..c068a8db2de 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -65,15 +65,12 @@ qt_internal_add_tool(${target_name} generators/unix generators/win32 library - "${CMAKE_CURRENT_BINARY_DIR}/library" # for qmakeconfig.cpp PRECOMPILED_HEADER "qmake_pch.h" LIBRARIES Qt::CorePrivate ) -qt_generate_qconfig_cpp(../src/corelib/global/qconfig.cpp.in library/qmakeconfig.cpp) - #### Keys ignored in scope 1:.:.:qmake.pro:: # _OPTION = "host_build" diff --git a/qmake/qmakelibraryinfo.cpp b/qmake/qmakelibraryinfo.cpp index 4edff1142a5..4398e911f1b 100644 --- a/qmake/qmakelibraryinfo.cpp +++ b/qmake/qmakelibraryinfo.cpp @@ -47,8 +47,6 @@ #include #include -#include - #include QT_BEGIN_NAMESPACE diff --git a/src/corelib/global/qconfig.cpp.in b/src/corelib/global/qconfig.cpp.in index e27f3c3e693..a552f6bfffb 100644 --- a/src/corelib/global/qconfig.cpp.in +++ b/src/corelib/global/qconfig.cpp.in @@ -1,100 +1,25 @@ -/* This file is used to generate the Qt configuration info for the Core library - * and the qmake executable. The 'qt_generate_qconfig_cpp' cmake routine +/* This file is used to generate the Qt configuration info for the Core library. + * The 'qt_generate_qconfig_cpp' cmake routine * contains variables that replace '@' entires in this file. It's important to * align these values with the following: * * - QLibraryInfo::LibraryPath enum in qtbase/src/corelib/global/qlibraryinfo.h - * - qtConfEntries in this file - * - QMakeLibraryInfo::LibraryPathQMakeExtras enum in - * qtbase/qmake/library/qmakelibraryinfo.h + * - qtConfEntries in qtbase/src/corelib/global/qlibraryinfo.cpp * - * The reason for this is pointer mathematics in the QMakeLibraryInfo and - * QLibraryInfo implementation when iterating qt_configure_strs. Also - * qtConfEntries are strongly bound to QLibraryInfo::LibraryPath and - * QMakeLibraryInfo::LibraryPathQMakeExtras enums. + * The reason for this is pointer mathematics in the QLibraryInfo implementation when iterating + * qt_configure_strs. Also qtConfEntries are strongly bound to QLibraryInfo::LibraryPath. */ /* Installation date */ static const char qt_configure_installation [12+11] = "qt_instdate=2012-12-20"; /* Installation Info */ static const char qt_configure_prefix_path_str [12+256] = "qt_prfxpath=@QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX@"; -#ifdef QT_BUILD_QMAKE -static const char qt_configure_ext_prefix_path_str [12+256] = "qt_epfxpath=@QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX@"; -static const char qt_configure_host_prefix_path_str [12+256] = "qt_hpfxpath=@QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX@"; -#endif static const short qt_configure_str_offsets[] = { @QT_CONFIG_STR_OFFSETS_FIRST@ -#ifdef QT_BUILD_QMAKE -@QT_CONFIG_STR_OFFSETS_SECOND@ -#endif }; static const char qt_configure_strs[] = @QT_CONFIG_STRS_FIRST@ -#ifdef QT_BUILD_QMAKE -@QT_CONFIG_STRS_SECOND@ -#endif ; #define QT_CONFIGURE_SETTINGS_PATH "@QT_SYS_CONF_DIR@" #define QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH "@QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH@" #define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12 -#ifdef QT_BUILD_QMAKE -# define QT_CONFIGURE_EXT_PREFIX_PATH qt_configure_ext_prefix_path_str + 12 -# define QT_CONFIGURE_HOST_PREFIX_PATH qt_configure_host_prefix_path_str + 12 -#endif - - -/* Entries below are shared between qmake and the Core library. Please pay - * attention and read the adding rules here and inside QLibraryInfo header. - * - * To add a new entry in QLibraryInfo::LibraryPath, add it to the enum - * in qtbase/src/corelib/global/qlibraryinfo.h and: - * - add its relative path in the qtConfEntries[] array below - * (the key is what appears in a qt.conf file) - * - add a property name in qmake/property.cpp propList[] array - * (it's used with qmake -query) - * - add to qt_config.prf, qt_module.prf, qt_module_fwdpri.prf - */ - -#ifdef QT_BUILD_QMAKE -constexpr size_t qtConfEntriesKeySize = 23; -#else -constexpr size_t qtConfEntriesKeySize = 19; -#endif - -static const struct { - char key[qtConfEntriesKeySize], value[13]; -} qtConfEntries[] = { - { "Prefix", "." }, - { "Documentation", "doc" }, // should be ${Data}/doc - { "Headers", "include" }, - { "Libraries", "lib" }, -#ifdef Q_OS_WIN - { "LibraryExecutables", "bin" }, -#else - { "LibraryExecutables", "libexec" }, // should be ${ArchData}/libexec -#endif - { "Binaries", "bin" }, - { "Plugins", "plugins" }, // should be ${ArchData}/plugins - { "Qml2Imports", "qml" }, // should be ${ArchData}/qml - { "ArchData", "." }, - { "Data", "." }, - { "Translations", "translations" }, // should be ${Data}/translations - { "Examples", "examples" }, - { "Tests", "tests" }, -// Put new entries above this line ONLY! -#ifdef QT_BUILD_QMAKE - { "HostBinaries", "bin" }, -#ifdef Q_OS_WIN - { "HostLibraryExecutables", "bin" }, -#else - { "HostLibraryExecutables", "libexec" }, -#endif - { "HostLibraries", "lib" }, - { "HostData", "." }, - { "HostPrefix", "" }, - { "TargetSpec", "" }, - { "HostSpec", "" }, - { "Sysroot", "" }, - { "SysrootifyPrefix", "" }, -#endif -}; diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 0bd6674b43d..0ace4ea1c52 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -297,6 +297,35 @@ QVersionNumber QLibraryInfo::version() noexcept } #endif // QT_BOOTSTRAPPED +/* + * To add a new entry in QLibraryInfo::LibraryPath, add it to the enum + * in qtbase/src/corelib/global/qlibraryinfo.h and: + * - add its relative path in the qtConfEntries[] array below + * (the key is what appears in a qt.conf file) + */ + +static const struct { + char key[19], value[13]; +} qtConfEntries[] = { + { "Prefix", "." }, + { "Documentation", "doc" }, // should be ${Data}/doc + { "Headers", "include" }, + { "Libraries", "lib" }, +#ifdef Q_OS_WIN + { "LibraryExecutables", "bin" }, +#else + { "LibraryExecutables", "libexec" }, // should be ${ArchData}/libexec +#endif + { "Binaries", "bin" }, + { "Plugins", "plugins" }, // should be ${ArchData}/plugins + { "Qml2Imports", "qml" }, // should be ${ArchData}/qml + { "ArchData", "." }, + { "Data", "." }, + { "Translations", "translations" }, // should be ${Data}/translations + { "Examples", "examples" }, + { "Tests", "tests" }, +}; + static QString prefixFromAppDirHelper() { QString appDir; From a21fe37c723f569887e5e7ba5a19f145134bd216 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 9 Mar 2021 15:42:54 +0100 Subject: [PATCH 10/10] Remove now unneeded QT_BOOTSTRAPPED check from qlibraryinfo.cpp Since qmake links against QtCore, we don't need to check for the bootstrapping case in qlibraryinfo.cpp anymore. Change-Id: I644b1e71db727773b3e32ac650481df134acf033 Reviewed-by: Alexey Edelev Reviewed-by: Alexandru Croitor Reviewed-by: Qt CI Bot --- src/corelib/global/qlibraryinfo.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 0ace4ea1c52..4d06ec6e3f1 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -284,7 +284,6 @@ QLibraryInfo::isDebugBuild() #endif } -#ifndef QT_BOOTSTRAPPED /*! \since 5.8 Returns the version of the Qt library. @@ -295,7 +294,6 @@ QVersionNumber QLibraryInfo::version() noexcept { return QVersionNumber(QT_VERSION_MAJOR, QT_VERSION_MINOR, QT_VERSION_PATCH); } -#endif // QT_BOOTSTRAPPED /* * To add a new entry in QLibraryInfo::LibraryPath, add it to the enum