Do not write Sysroot and SysrootifyPrefix into qmakeconfig.cpp
Those have fixed values. Change-Id: I7f1ba8036f43413d3c805f4b419ae79e037343fb Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
504d0c3755
commit
c651e7ba18
@ -53,8 +53,6 @@ function(qt_generate_qconfig_cpp in_file out_file)
|
|||||||
set(QT_CONFIG_STR_OFFSETS "")
|
set(QT_CONFIG_STR_OFFSETS "")
|
||||||
set(QT_CONFIG_STRS "")
|
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_BINDIR}")
|
||||||
qt_add_string_to_qconfig_cpp("${INSTALL_LIBEXECDIR}")
|
qt_add_string_to_qconfig_cpp("${INSTALL_LIBEXECDIR}")
|
||||||
qt_add_string_to_qconfig_cpp("${INSTALL_LIBDIR}")
|
qt_add_string_to_qconfig_cpp("${INSTALL_LIBDIR}")
|
||||||
|
@ -143,7 +143,7 @@ QString QMakeLibraryInfo::path(int loc)
|
|||||||
QString ret = rawLocation(loc, QMakeLibraryInfo::FinalPaths);
|
QString ret = rawLocation(loc, QMakeLibraryInfo::FinalPaths);
|
||||||
|
|
||||||
// Automatically prepend the sysroot to target paths
|
// Automatically prepend the sysroot to target paths
|
||||||
if (loc < QMakeLibraryInfo::SysrootPath || loc > QMakeLibraryInfo::LastHostPath)
|
if (loc < QMakeLibraryInfo::FirstHostPath || loc > QMakeLibraryInfo::LastHostPath)
|
||||||
sysrootify(ret);
|
sysrootify(ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -158,7 +158,12 @@ struct LocationInfo
|
|||||||
static LocationInfo defaultLocationInfo(int loc)
|
static LocationInfo defaultLocationInfo(int loc)
|
||||||
{
|
{
|
||||||
LocationInfo result;
|
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.key = QLatin1String(qtConfEntries[loc].key);
|
||||||
result.defaultValue = QLatin1String(qtConfEntries[loc].value);
|
result.defaultValue = QLatin1String(qtConfEntries[loc].value);
|
||||||
}
|
}
|
||||||
@ -171,6 +176,37 @@ static LocationInfo defaultLocationInfo(int loc)
|
|||||||
return result;
|
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 QMakeLibraryInfo::rawLocation(int loc, QMakeLibraryInfo::PathGroup group)
|
||||||
{
|
{
|
||||||
QString ret;
|
QString ret;
|
||||||
@ -241,27 +277,8 @@ QString QMakeLibraryInfo::rawLocation(int loc, QMakeLibraryInfo::PathGroup group
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fromConf) {
|
if (!fromConf)
|
||||||
// "volatile" here is a hack to prevent compilers from doing a
|
ret = storedPath(loc);
|
||||||
// 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
// These values aren't actually paths and thus need to be returned verbatim.
|
// These values aren't actually paths and thus need to be returned verbatim.
|
||||||
if (loc == TargetSpecPath || loc == HostSpecPath || loc == SysrootifyPrefixPath)
|
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 == PrefixPath while a sysroot is set would make no sense here.
|
||||||
// loc == SysrootPath only makes sense if qmake lives inside the sysroot itself.
|
// loc == SysrootPath only makes sense if qmake lives inside the sysroot itself.
|
||||||
baseDir = QFileInfo(libraryInfoFile()).absolutePath();
|
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.
|
// We make any other host path absolute to the host prefix directory.
|
||||||
baseDir = rawLocation(HostPrefixPath, group);
|
baseDir = rawLocation(HostPrefixPath, group);
|
||||||
} else {
|
} else {
|
||||||
|
@ -59,16 +59,17 @@ struct QMakeLibraryInfo
|
|||||||
* See qconfig.cpp.in and QLibraryInfo for details.
|
* See qconfig.cpp.in and QLibraryInfo for details.
|
||||||
*/
|
*/
|
||||||
enum LibraryPathQMakeExtras {
|
enum LibraryPathQMakeExtras {
|
||||||
SysrootPath = QLibraryInfo::TestsPath + 1,
|
HostBinariesPath = QLibraryInfo::TestsPath + 1,
|
||||||
SysrootifyPrefixPath,
|
FirstHostPath = HostBinariesPath,
|
||||||
HostBinariesPath,
|
|
||||||
HostLibraryExecutablesPath,
|
HostLibraryExecutablesPath,
|
||||||
HostLibrariesPath,
|
HostLibrariesPath,
|
||||||
HostDataPath,
|
HostDataPath,
|
||||||
TargetSpecPath,
|
TargetSpecPath,
|
||||||
HostSpecPath,
|
HostSpecPath,
|
||||||
HostPrefixPath,
|
HostPrefixPath,
|
||||||
LastHostPath = HostPrefixPath,
|
SysrootPath,
|
||||||
|
SysrootifyPrefixPath,
|
||||||
|
LastHostPath = SysrootifyPrefixPath
|
||||||
};
|
};
|
||||||
enum PathGroup { FinalPaths, EffectivePaths, EffectiveSourcePaths, DevicePaths };
|
enum PathGroup { FinalPaths, EffectivePaths, EffectiveSourcePaths, DevicePaths };
|
||||||
static QString rawLocation(int loc, PathGroup group);
|
static QString rawLocation(int loc, PathGroup group);
|
||||||
|
@ -83,8 +83,6 @@ static const struct {
|
|||||||
{ "Tests", "tests" },
|
{ "Tests", "tests" },
|
||||||
// Put new entries above this line ONLY!
|
// Put new entries above this line ONLY!
|
||||||
#ifdef QT_BUILD_QMAKE
|
#ifdef QT_BUILD_QMAKE
|
||||||
{ "Sysroot", "" },
|
|
||||||
{ "SysrootifyPrefix", "" },
|
|
||||||
{ "HostBinaries", "bin" },
|
{ "HostBinaries", "bin" },
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
{ "HostLibraryExecutables", "bin" },
|
{ "HostLibraryExecutables", "bin" },
|
||||||
@ -96,5 +94,7 @@ static const struct {
|
|||||||
{ "TargetSpec", "" },
|
{ "TargetSpec", "" },
|
||||||
{ "HostSpec", "" },
|
{ "HostSpec", "" },
|
||||||
{ "HostPrefix", "" },
|
{ "HostPrefix", "" },
|
||||||
|
{ "Sysroot", "" },
|
||||||
|
{ "SysrootifyPrefix", "" },
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user