Add the support for target-based android-build directories

When building using CMake it's possible that single CMakeLists.txt may
contain multiple android executables. In this case android-build
directory mixes the build artifacts from multiple targets. This patch
allows using per-target android-build directories in case if Qt support
this. The QT_INTERNAL_ANDROID_TARGET_BUILD_DIR_SUPPORT cache variable
indicates that Qt has builtin support of this feature and the
QT_USE_TARGET_ANDROID_BUILD_DIR cache variable should be set to TRUE
by user to enable the functionality project-wide.

Task-number: QTBUG-117443
Change-Id: Ic8f576e528ee918a3ebf075a25fa2a414ef85736
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Alexey Edelev
2023-11-21 15:58:39 +01:00
parent 88c12bc784
commit de3d4e23ea
3 changed files with 25 additions and 1 deletions

View File

@@ -221,7 +221,13 @@ bool isQtCreatorGenerated(const FilePath &deploymentFile)
FilePath androidBuildDirectory(const Target *target)
{
return buildDirectory(target) / Constants::ANDROID_BUILD_DIRECTORY;
QString suffix;
const Project *project = target->project();
if (project->extraData(Android::Constants::AndroidBuildTargetDirSupport).toBool()
&& project->extraData(Android::Constants::UseAndroidBuildTargetDir).toBool())
suffix = QString("-%1").arg(target->activeBuildKey());
return buildDirectory(target) / (Constants::ANDROID_BUILD_DIRECTORY + suffix);
}
FilePath androidAppProcessDir(const Target *target)