Tools: add QLibraryInfo to the bootstrapped library.
For future use by qdoc. Change-Id: Id9079a6fa581ff16810df9a8f2bb94314ee11ca9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
This commit is contained in:
parent
e0b5571b53
commit
f71170aa35
@ -645,7 +645,7 @@ qmakeAddCacheClear(qmakeCacheClearFunc func, void **data)
|
||||
cache_items.append(new QMakeCacheClearItem(func, data));
|
||||
}
|
||||
|
||||
QString qmake_libraryInfoFile()
|
||||
QString qt_libraryInfoFile()
|
||||
{
|
||||
if (!Option::globals->qmake_abslocation.isEmpty())
|
||||
return QDir(QFileInfo(Option::globals->qmake_abslocation).absolutePath()).filePath("qt.conf");
|
||||
|
@ -47,8 +47,16 @@
|
||||
|
||||
#ifdef QT_BUILD_QMAKE
|
||||
QT_BEGIN_NAMESPACE
|
||||
extern QString qmake_libraryInfoFile();
|
||||
extern QString qt_libraryInfoFile();
|
||||
QT_END_NAMESPACE
|
||||
#elif defined(QT_BOOTSTRAPPED)
|
||||
QString qt_libraryInfoFile()
|
||||
{
|
||||
QString qmakeAbsoluteLocation = QLatin1String(QT_QMAKE_LOCATION);
|
||||
if (!qmakeAbsoluteLocation.isEmpty())
|
||||
return QDir(QFileInfo(qmakeAbsoluteLocation).absolutePath()).filePath(QLatin1String("qt.conf"));
|
||||
return QString();
|
||||
}
|
||||
#else
|
||||
# include "qcoreapplication.h"
|
||||
#endif
|
||||
@ -69,7 +77,7 @@ struct QLibrarySettings
|
||||
{
|
||||
QLibrarySettings();
|
||||
QScopedPointer<QSettings> settings;
|
||||
#ifdef QT_BUILD_QMAKE
|
||||
#ifdef QT_BOOTSTRAPPED
|
||||
bool haveEffectivePaths;
|
||||
bool havePaths;
|
||||
#endif
|
||||
@ -80,7 +88,7 @@ class QLibraryInfoPrivate
|
||||
{
|
||||
public:
|
||||
static QSettings *findConfiguration();
|
||||
#ifndef QT_BUILD_QMAKE
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
static void cleanup()
|
||||
{
|
||||
QLibrarySettings *ls = qt_library_settings();
|
||||
@ -105,7 +113,7 @@ public:
|
||||
QLibrarySettings::QLibrarySettings()
|
||||
: settings(QLibraryInfoPrivate::findConfiguration())
|
||||
{
|
||||
#ifndef QT_BUILD_QMAKE
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
qAddPostRoutine(QLibraryInfoPrivate::cleanup);
|
||||
bool haveEffectivePaths;
|
||||
bool havePaths;
|
||||
@ -117,7 +125,7 @@ QLibrarySettings::QLibrarySettings()
|
||||
haveEffectivePaths = children.contains(QLatin1String("EffectivePaths"));
|
||||
// Backwards compat: an existing but empty file is claimed to contain the Paths section.
|
||||
havePaths = !haveEffectivePaths || children.contains(QLatin1String("Paths"));
|
||||
#ifndef QT_BUILD_QMAKE
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
if (!havePaths)
|
||||
settings.reset(0);
|
||||
#else
|
||||
@ -131,9 +139,9 @@ QLibrarySettings::QLibrarySettings()
|
||||
QSettings *QLibraryInfoPrivate::findConfiguration()
|
||||
{
|
||||
QString qtconfig = QStringLiteral(":/qt/etc/qt.conf");
|
||||
#ifdef QT_BUILD_QMAKE
|
||||
#ifdef QT_BOOTSTRAPPED
|
||||
if(!QFile::exists(qtconfig))
|
||||
qtconfig = qmake_libraryInfoFile();
|
||||
qtconfig = qt_libraryInfoFile();
|
||||
#else
|
||||
if (!QFile::exists(qtconfig) && QCoreApplication::instance()) {
|
||||
#ifdef Q_OS_MAC
|
||||
@ -181,7 +189,7 @@ QSettings *QLibraryInfoPrivate::findConfiguration()
|
||||
\sa QSysInfo, {Using qt.conf}
|
||||
*/
|
||||
|
||||
#ifndef QT_BUILD_QMAKE
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
|
||||
/*!
|
||||
\internal
|
||||
@ -246,7 +254,7 @@ QLibraryInfo::isDebugBuild()
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // QT_BUILD_QMAKE
|
||||
#endif // QT_BOOTSTRAPPED
|
||||
|
||||
static const struct {
|
||||
char key[14], value[13];
|
||||
@ -262,7 +270,7 @@ static const struct {
|
||||
{ "Translations", "translations" },
|
||||
{ "Examples", "examples" },
|
||||
{ "Tests", "tests" },
|
||||
#ifdef QT_BUILD_QMAKE
|
||||
#ifdef QT_BOOTSTRAPPED
|
||||
{ "Sysroot", "" },
|
||||
{ "HostPrefix", "" },
|
||||
{ "HostBinaries", "bin" },
|
||||
@ -277,7 +285,7 @@ static const struct {
|
||||
QString
|
||||
QLibraryInfo::location(LibraryLocation loc)
|
||||
{
|
||||
#ifdef QT_BUILD_QMAKE
|
||||
#ifdef QT_BOOTSTRAPPED
|
||||
QString ret = rawLocation(loc, FinalPaths);
|
||||
|
||||
// Automatically prepend the sysroot to target paths
|
||||
@ -301,7 +309,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
|
||||
# define group dummy
|
||||
#endif
|
||||
QString ret;
|
||||
#ifdef QT_BUILD_QMAKE
|
||||
#ifdef QT_BOOTSTRAPPED
|
||||
// Logic for choosing the right data source: if EffectivePaths are requested
|
||||
// and qt.conf with that section is present, use it, otherwise fall back to
|
||||
// FinalPaths. For FinalPaths, use qt.conf if present and contains not only
|
||||
@ -339,14 +347,14 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
|
||||
if(!key.isNull()) {
|
||||
QSettings *config = QLibraryInfoPrivate::configuration();
|
||||
config->beginGroup(QLatin1String(
|
||||
#ifdef QT_BUILD_QMAKE
|
||||
#ifdef QT_BOOTSTRAPPED
|
||||
group == EffectivePaths ? "EffectivePaths" :
|
||||
#endif
|
||||
"Paths"));
|
||||
|
||||
ret = config->value(key, defaultValue).toString();
|
||||
|
||||
#ifdef QT_BUILD_QMAKE
|
||||
#ifdef QT_BOOTSTRAPPED
|
||||
if (ret.isEmpty() && loc == HostPrefixPath)
|
||||
ret = config->value(QLatin1String(qtConfEntries[PrefixPath].key),
|
||||
QLatin1String(qtConfEntries[PrefixPath].value)).toString();
|
||||
@ -371,12 +379,12 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
|
||||
|
||||
if (!ret.isEmpty() && QDir::isRelativePath(ret)) {
|
||||
QString baseDir;
|
||||
#ifdef QT_BUILD_QMAKE
|
||||
#ifdef QT_BOOTSTRAPPED
|
||||
if (loc == HostPrefixPath || loc == PrefixPath || loc == SysrootPath) {
|
||||
// We make the prefix/sysroot path absolute to the executable's directory.
|
||||
// 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(qmake_libraryInfoFile()).absolutePath();
|
||||
baseDir = QFileInfo(qt_libraryInfoFile()).absolutePath();
|
||||
} else if (loc > SysrootPath && loc <= LastHostPath) {
|
||||
// We make any other host path absolute to the host prefix directory.
|
||||
baseDir = rawLocation(HostPrefixPath, group);
|
||||
|
@ -75,7 +75,7 @@ public:
|
||||
ExamplesPath,
|
||||
TestsPath,
|
||||
// Insert new values above this line
|
||||
#ifdef QT_BUILD_QMAKE
|
||||
#ifdef QT_BOOTSTRAPPED
|
||||
// These are not subject to binary compatibility constraints
|
||||
SysrootPath,
|
||||
HostPrefixPath,
|
||||
@ -86,7 +86,7 @@ public:
|
||||
SettingsPath = 100
|
||||
};
|
||||
static QString location(LibraryLocation); // ### Qt 6: consider renaming it to path()
|
||||
#ifdef QT_BUILD_QMAKE
|
||||
#ifdef QT_BOOTSTRAPPED
|
||||
enum PathGroup { FinalPaths, EffectivePaths };
|
||||
static QString rawLocation(LibraryLocation, PathGroup);
|
||||
#endif
|
||||
|
@ -22,12 +22,14 @@ DEFINES += \
|
||||
QT_NO_THREAD \
|
||||
QT_NO_UNICODETABLES \
|
||||
QT_NO_USING_NAMESPACE \
|
||||
QT_NO_DEPRECATED
|
||||
QT_NO_DEPRECATED \
|
||||
QT_QMAKE_LOCATION=\\\"$$QMAKE_QMAKE\\\"
|
||||
|
||||
INCLUDEPATH += $$QT_BUILD_TREE/include \
|
||||
$$QT_BUILD_TREE/include/QtCore \
|
||||
$$QT_BUILD_TREE/include/QtCore/$$QT_VERSION \
|
||||
$$QT_BUILD_TREE/include/QtCore/$$QT_VERSION/QtCore
|
||||
$$QT_BUILD_TREE/include/QtCore/$$QT_VERSION/QtCore \
|
||||
$$QT_BUILD_TREE/src/corelib/global
|
||||
|
||||
DEPENDPATH += $$INCLUDEPATH \
|
||||
../../corelib/global \
|
||||
@ -42,6 +44,7 @@ SOURCES += \
|
||||
../../corelib/codecs/qtextcodec.cpp \
|
||||
../../corelib/codecs/qutfcodec.cpp \
|
||||
../../corelib/global/qglobal.cpp \
|
||||
../../corelib/global/qlibraryinfo.cpp \
|
||||
../../corelib/global/qlogging.cpp \
|
||||
../../corelib/global/qmalloc.cpp \
|
||||
../../corelib/global/qnumeric.cpp \
|
||||
@ -58,6 +61,7 @@ SOURCES += \
|
||||
../../corelib/io/qfsfileengine_iterator.cpp \
|
||||
../../corelib/io/qiodevice.cpp \
|
||||
../../corelib/io/qfiledevice.cpp \
|
||||
../../corelib/io/qsettings.cpp \
|
||||
../../corelib/io/qtemporaryfile.cpp \
|
||||
../../corelib/io/qtextstream.cpp \
|
||||
../../corelib/kernel/qcoreglobaldata.cpp \
|
||||
@ -101,11 +105,13 @@ unix:SOURCES += ../../corelib/io/qfilesystemengine_unix.cpp \
|
||||
win32:SOURCES += ../../corelib/io/qfilesystemengine_win.cpp \
|
||||
../../corelib/io/qfilesystemiterator_win.cpp \
|
||||
../../corelib/io/qfsfileengine_win.cpp \
|
||||
../../corelib/io/qsettings_win.cpp \
|
||||
../../corelib/plugin/qsystemlibrary.cpp \
|
||||
|
||||
macx: {
|
||||
SOURCES += ../../corelib/io/qfilesystemengine_mac.cpp
|
||||
SOURCES += ../../corelib/kernel/qcore_mac.cpp
|
||||
SOURCES += ../../corelib/io/qfilesystemengine_mac.cpp \
|
||||
../../corelib/io/qsettings_mac.cpp \
|
||||
../../corelib/kernel/qcore_mac.cpp
|
||||
LIBS += -framework CoreServices
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user