diff options
author | Jani Korteniemi <[email protected]> | 2025-05-16 10:17:22 +0300 |
---|---|---|
committer | Jani Korteniemi <[email protected]> | 2025-06-12 08:58:39 +0300 |
commit | 3047d6a8a19fed870597d6c482f6c1a826ffb9f2 (patch) | |
tree | 50f30747657b8defd531ace52f6acdb96b953a48 | |
parent | 270b2194106224c0dfb2221bcd85676a747b4f13 (diff) |
Fix androiddeployqt copying build directory
When project's Android package source directory is set to the
project level (instead of project/android) androiddeployqt keeps
copying the build directory under itself infinitely.
Add check to copyFiles:
-If android source dir is the same as project source dir
-And if current directory copied is in build directory path
Pick-to: 6.5 6.8 6.9 6.10
Fixes: QTBUG-126743
Change-Id: If45766152c6cbf9e2ee916baa5a15282d3fedaf2
Reviewed-by: Assam Boudjelthia <[email protected]>
-rw-r--r-- | src/tools/androiddeployqt/main.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 62cdb345e57..e93c3038fca 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -1498,6 +1498,10 @@ bool copyFiles(const QDir &sourceDirectory, const QDir &destinationDirectory, co for (const QFileInfo &entry : entries) { if (entry.isDir()) { QDir dir(entry.absoluteFilePath()); + const bool destinationInCopyDir = destinationDirectory.absolutePath().startsWith(dir.absolutePath()); + if (sourceDirectory == options.androidSourceDirectory && destinationInCopyDir) + continue; + if (!destinationDirectory.mkpath(dir.dirName())) { fprintf(stderr, "Cannot make directory %s in %s\n", qPrintable(dir.dirName()), qPrintable(destinationDirectory.path())); return false; |