summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-03-05 18:12:31 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2021-03-11 10:00:01 +0100
commita08b1f63595f61e7fa12b04d516ec20396906c9e (patch)
tree595de4fd849c1e865a5c0ac9590addf416d4bfc8 /qmake
parent3c12ab974ffa7aa51ca157989997f6e10c1c2259 (diff)
Read QLibraryInfo paths directly from QLibraryInfo and not from qmakeconfig.cpp
Change-Id: I1db1c871ec6b4e572bd36df6aff7a5be8a4a706c Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/qmakelibraryinfo.cpp24
-rw-r--r--qmake/qmakelibraryinfo.h6
2 files changed, 14 insertions, 16 deletions
diff --git a/qmake/qmakelibraryinfo.cpp b/qmake/qmakelibraryinfo.cpp
index 365e72e0fc..c8461c1d75 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<QLibraryInfo::LibraryPath>(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<QLibraryInfo::LibraryPath>(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 8d9f1455e6..bf1bae81d8 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);