From 1043bf202bb848f8286f2c67ed2b8760fe9da8da Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 3 Dec 2014 22:07:29 +0100 Subject: introduce /dev variants of qmake properties these reflect the on-target paths (unlike /raw, which are host paths, just without the -sysroot). this is necessary for anything deployment-related, starting with RPATH. Change-Id: I13d598995d0e4d6cb0dc1fc7938b8631cf3e3a95 Reviewed-by: Joerg Bornemann --- src/corelib/global/qlibraryinfo.cpp | 25 ++++++++++++++++++++----- src/corelib/global/qlibraryinfo.h | 2 +- 2 files changed, 21 insertions(+), 6 deletions(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index a75fb365a3..dc04f898f7 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -65,6 +65,7 @@ struct QLibrarySettings QLibrarySettings(); QScopedPointer settings; #ifdef QT_BUILD_QMAKE + bool haveDevicePaths; bool haveEffectiveSourcePaths; bool haveEffectivePaths; bool havePaths; @@ -83,7 +84,10 @@ public: return ls ? (group == QLibraryInfo::EffectiveSourcePaths ? ls->haveEffectiveSourcePaths : group == QLibraryInfo::EffectivePaths - ? ls->haveEffectivePaths : ls->havePaths) : false; + ? ls->haveEffectivePaths + : group == QLibraryInfo::DevicePaths + ? ls->haveDevicePaths + : ls->havePaths) : false; } #endif static QSettings *configuration() @@ -99,6 +103,7 @@ QLibrarySettings::QLibrarySettings() : settings(QLibraryInfoPrivate::findConfiguration()) { #ifndef QT_BUILD_QMAKE + bool haveDevicePaths; bool haveEffectivePaths; bool havePaths; #endif @@ -106,6 +111,7 @@ QLibrarySettings::QLibrarySettings() // This code needs to be in the regular library, as otherwise a qt.conf that // works for qmake would break things for dynamically built Qt tools. QStringList children = settings->childGroups(); + haveDevicePaths = children.contains(QLatin1String("DevicePaths")); #ifdef QT_BUILD_QMAKE haveEffectiveSourcePaths = children.contains(QLatin1String("EffectiveSourcePaths")); #else @@ -114,13 +120,15 @@ QLibrarySettings::QLibrarySettings() #endif haveEffectivePaths = haveEffectiveSourcePaths || children.contains(QLatin1String("EffectivePaths")); // Backwards compat: an existing but empty file is claimed to contain the Paths section. - havePaths = (!haveEffectivePaths && !children.contains(QLatin1String(platformsSection))) + havePaths = (!haveDevicePaths && !haveEffectivePaths + && !children.contains(QLatin1String(platformsSection))) || children.contains(QLatin1String("Paths")); #ifndef QT_BUILD_QMAKE if (!havePaths) settings.reset(0); #else } else { + haveDevicePaths = false; haveEffectiveSourcePaths = false; haveEffectivePaths = false; havePaths = false; @@ -404,11 +412,12 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) // FinalPaths. For FinalPaths, use qt.conf if present and contains not only // [EffectivePaths], otherwise fall back to builtins. // EffectiveSourcePaths falls back to EffectivePaths. + // DevicePaths falls back to FinalPaths. PathGroup orig_group = group; if (!QLibraryInfoPrivate::haveGroup(group) && !(group == EffectiveSourcePaths && (group = EffectivePaths, QLibraryInfoPrivate::haveGroup(group))) - && !(group == EffectivePaths + && !((group == EffectivePaths || group == DevicePaths) && (group = FinalPaths, QLibraryInfoPrivate::haveGroup(group))) && (group = orig_group, true)) #elif !defined(QT_NO_SETTINGS) @@ -417,14 +426,19 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) { const char *path = 0; if (loc == PrefixPath) { - path = QT_CONFIGURE_PREFIX_PATH; + path = +#ifdef QT_BUILD_QMAKE + (group != DevicePaths) ? + QT_CONFIGURE_EXT_PREFIX_PATH : +#endif + QT_CONFIGURE_PREFIX_PATH; } 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 == SettingsPath) { path = QT_CONFIGURE_SETTINGS_PATH; #endif -#ifdef QT_BOOTSTRAPPED +#ifdef QT_BUILD_QMAKE } else if (loc == HostPrefixPath) { path = QT_CONFIGURE_HOST_PREFIX_PATH; #endif @@ -449,6 +463,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) QSettings *config = QLibraryInfoPrivate::configuration(); config->beginGroup(QLatin1String( #ifdef QT_BUILD_QMAKE + group == DevicePaths ? "DevicePaths" : group == EffectiveSourcePaths ? "EffectiveSourcePaths" : group == EffectivePaths ? "EffectivePaths" : #endif diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h index 8dccb25665..4dff8ca494 100644 --- a/src/corelib/global/qlibraryinfo.h +++ b/src/corelib/global/qlibraryinfo.h @@ -88,7 +88,7 @@ public: }; static QString location(LibraryLocation); // ### Qt 6: consider renaming it to path() #ifdef QT_BUILD_QMAKE - enum PathGroup { FinalPaths, EffectivePaths, EffectiveSourcePaths }; + enum PathGroup { FinalPaths, EffectivePaths, EffectiveSourcePaths, DevicePaths }; static QString rawLocation(LibraryLocation, PathGroup); #endif -- cgit v1.2.3