From 87bfd3308209c3f859d116c024de1d2c35bf18b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Keller?= Date: Wed, 5 Jul 2023 11:38:11 +0200 Subject: [PATCH] Windeployqt: also add internal modules to module list Not adding internal modules to the windeployqt module list makes it give off nonsensical warnings, and can force the deployment of debug libraries despite a --release tag. Add them in to prevent this, and shave off the "Private" part of the module name if it exists to maintain compatibility. Fixes: QTBUG-114854 Pick-to: 6.6 6.5 Change-Id: I884fdc495f340ad20ba6257587da170d6c1a1415 Reviewed-by: Joerg Bornemann Reviewed-by: Oliver Wolff --- src/tools/windeployqt/main.cpp | 2 ++ src/tools/windeployqt/qtmoduleinfo.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tools/windeployqt/main.cpp b/src/tools/windeployqt/main.cpp index 2db166d54e8..feb4b909797 100644 --- a/src/tools/windeployqt/main.cpp +++ b/src/tools/windeployqt/main.cpp @@ -107,6 +107,8 @@ static QByteArray formatQtModules(const ModuleBitset &mask, bool option = false) result.append(option ? moduleNameToOptionName(qtModule.name).toUtf8() : qtModule.name.toUtf8()); + if (qtModule.internal) + result.append("Internal"); } } return result; diff --git a/src/tools/windeployqt/qtmoduleinfo.cpp b/src/tools/windeployqt/qtmoduleinfo.cpp index 57aa8e54a04..ebef4f1de4e 100644 --- a/src/tools/windeployqt/qtmoduleinfo.cpp +++ b/src/tools/windeployqt/qtmoduleinfo.cpp @@ -140,8 +140,8 @@ bool QtModuleInfoStore::populate(const QString &modulesDir, const QString &trans QtModule module = moduleFromJsonFile(filePath, errorString); if (!errorString->isEmpty()) return false; - if (module.internal) - continue; + if (module.internal && module.name.endsWith(QStringLiteral("Private"))) + module.name.chop(7); module.id = modules.size(); if (module.id == QtModule::InvalidId) { *errorString = "Internal Error: too many modules for ModuleBitset to hold."_L1;