forked from qt-creator/qt-creator
Android: use correct variable for Android SDK with CMake for Qt 6
Qt 6 for Android with CMake uses ANDROID_SDK_ROOT (similar to qmake), instead of ANDROID_SDK. Task-number: QTCREATORBUG-24678 Change-Id: Ic858b8d76b41b57ef35864a1981ebd142d0cccfd Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -165,21 +165,25 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Utils::Id id)
|
||||
}
|
||||
initialArgs.append(QString::fromLatin1("-DANDROID_ABI:STRING=%1").arg(preferredAbi));
|
||||
|
||||
QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(k);
|
||||
if (qt && qt->supportsMultipleQtAbis()) {
|
||||
auto sdkLocation = bs->data(Android::Constants::SdkLocation).value<FilePath>();
|
||||
initialArgs.append(
|
||||
QString::fromLatin1("-DANDROID_SDK:PATH=%1").arg(sdkLocation.toString()));
|
||||
}
|
||||
|
||||
initialArgs.append(QString::fromLatin1("-DANDROID_STL:STRING=c++_shared"));
|
||||
|
||||
initialArgs.append(
|
||||
QString::fromLatin1("-DCMAKE_FIND_ROOT_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}"));
|
||||
|
||||
QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(k);
|
||||
QString androidSdkKey = "-DANDROID_SDK";
|
||||
|
||||
if (qt->qtVersion() >= QtSupport::QtVersionNumber{6, 0, 0}) {
|
||||
initialArgs.append(
|
||||
QString::fromLatin1("-DQT_HOST_PATH:PATH=%{Qt:QT_HOST_PREFIX}"));
|
||||
|
||||
androidSdkKey.append("_ROOT");
|
||||
}
|
||||
|
||||
if (qt && qt->supportsMultipleQtAbis()) {
|
||||
auto sdkLocation = bs->data(Android::Constants::SdkLocation).value<FilePath>();
|
||||
initialArgs.append(
|
||||
QString("%1:PATH=%2").arg(androidSdkKey).arg(sdkLocation.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user