forked from qt-creator/qt-creator
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:
@@ -1183,6 +1183,21 @@ void CMakeBuildSystem::updateCMakeConfiguration(QString &errorMessage)
|
||||
cmakeConfig.append(ci);
|
||||
}
|
||||
}
|
||||
|
||||
const bool hasAndroidTargetBuildDirSupport
|
||||
= CMakeConfigItem::toBool(
|
||||
cmakeConfig.stringValueOf("QT_INTERNAL_ANDROID_TARGET_BUILD_DIR_SUPPORT"))
|
||||
.value_or(false);
|
||||
|
||||
const bool useAndroidTargetBuildDir
|
||||
= CMakeConfigItem::toBool(cmakeConfig.stringValueOf("QT_USE_TARGET_ANDROID_BUILD_DIR"))
|
||||
.value_or(false);
|
||||
|
||||
project()->setExtraData(Android::Constants::AndroidBuildTargetDirSupport,
|
||||
QVariant::fromValue(hasAndroidTargetBuildDirSupport));
|
||||
project()->setExtraData(Android::Constants::UseAndroidBuildTargetDir,
|
||||
QVariant::fromValue(useAndroidTargetBuildDir));
|
||||
|
||||
setConfigurationFromCMake(cmakeConfig);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user