From 43ba45151a8769860c62c9dc5515910d94411bf9 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Wed, 12 May 2021 14:15:31 +0200 Subject: [PATCH] Follow the generic logic of QLibraryInfo when computing QT_HOST_PREFIX After the discussion we concluded that QT_HOST_PREFIX should not completely replicate the QT_INSTALL_PREFIX behavior. So this patch implements the following logic if qt.conf is provided: 1. Prefix is not set a. If HostPrefix is not specified, then QT_HOST_PREFIX will be set to the folder containing qt.conf. b. If HostPrefix is specified and is relative, then QT_HOST_PREFIX will be relative to the folder containing qt.conf. 2. Prefix is set a. If HostPrefix is not specified, then QT_HOST_PREFIX will have the Prefix value. b. If HostPrefix is specified and is relative, then QT_HOST_PREFIX will be relative to the folder containing the qt.conf. The logic might change in a future commit to use the current application directory instead of qt.conf path, since the use of qt.conf is dictated by the bootstrap library and this is no longer the case. Fixes: QTBUG-93707 Change-Id: I5460c97c45924bb8e0c95493afdb9585994c5f28 Reviewed-by: Alexandru Croitor --- qmake/qmakelibraryinfo.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/qmake/qmakelibraryinfo.cpp b/qmake/qmakelibraryinfo.cpp index 445ebce35b..257d23cbb6 100644 --- a/qmake/qmakelibraryinfo.cpp +++ b/qmake/qmakelibraryinfo.cpp @@ -224,15 +224,13 @@ QString QMakeLibraryInfo::rawLocation(int loc, QMakeLibraryInfo::PathGroup group : group == EffectivePaths ? "EffectivePaths" : "Paths")); - ret = config->value(locinfo.key, locinfo.defaultValue).toString(); - + ret = config->value(locinfo.key).toString(); if (ret.isEmpty()) { - if (loc == HostPrefixPath) { - locinfo = defaultLocationInfo(QLibraryInfo::PrefixPath); - ret = config->value(locinfo.key, locinfo.defaultValue).toString(); - } else if (loc == TargetSpecPath || loc == HostSpecPath - || loc == SysrootifyPrefixPath) { + if (loc == HostPrefixPath || loc == TargetSpecPath || loc == HostSpecPath + || loc == SysrootifyPrefixPath || loc == QLibraryInfo::PrefixPath) { fromConf = false; + } else { + ret = locinfo.defaultValue; } // The last case here is SysrootPath, which can be legitimately empty. // All other keys have non-empty fallbacks to start with.