Windeployqt: Multiple directory use warning

Added a warning for when windeployqt is used with multiple binaries
which are in different directories.

Pick-to: 6.5
Change-Id: Ic43aa9847eb2bf6927cebf5d457595eed6b16b5a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
Timothée Keller 2022-12-13 12:39:47 +01:00
parent 0d7401d51b
commit a67607480d

View File

@ -677,6 +677,7 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse
} // directory.
// Remaining files or plugin directories
bool multipleDirs = false;
for (int i = 1; i < posArgs.size(); ++i) {
const QFileInfo fi(QDir::cleanPath(posArgs.at(i)));
const QString path = fi.absoluteFilePath();
@ -690,9 +691,13 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse
for (const QString &library : libraries)
options->binaries.append(path + u'/' + library);
} else {
if (fi.absolutePath() != options->directory)
multipleDirs = true;
options->binaries.append(path);
}
}
if (multipleDirs)
std::wcerr << "Warning: using binaries from different directories\n";
options->translationsDirectory = options->directory + "/translations"_L1;
return 0;
}