Android: enable androiddeployqt to get the host's rcc binary path
Since Qt 6 CMake installs the host and target into separate directories, androiddeployqt fails to get the correct path to rcc. This change includes the host's rcc binary path in deployment-settings.json. Task-number: QTBUG-85399 Change-Id: I610bb6fea1180a119e4c0ceb75bf78c175ae430e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
parent
70def4341a
commit
09ac1bdfc5
@ -157,7 +157,7 @@ endif()
|
|||||||
" \"application-binary\": \"${target_output_name}\",\n")
|
" \"application-binary\": \"${target_output_name}\",\n")
|
||||||
|
|
||||||
# Override qmlimportscanner binary path
|
# Override qmlimportscanner binary path
|
||||||
set(qml_importscanner_binary_path "${QT_HOST_PATH}/bin/qmlimportscanner")
|
set(qml_importscanner_binary_path "${QT_HOST_PATH}/${QT6_HOST_INFO_BINDIR}/qmlimportscanner")
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
string(APPEND qml_importscanner_binary_path ".exe")
|
string(APPEND qml_importscanner_binary_path ".exe")
|
||||||
endif()
|
endif()
|
||||||
@ -165,6 +165,15 @@ endif()
|
|||||||
string(APPEND file_contents
|
string(APPEND file_contents
|
||||||
" \"qml-importscanner-binary\" : \"${qml_importscanner_binary_path_native}\",\n")
|
" \"qml-importscanner-binary\" : \"${qml_importscanner_binary_path_native}\",\n")
|
||||||
|
|
||||||
|
# Override rcc binary path
|
||||||
|
set(rcc_binary_path "${QT_HOST_PATH}/${QT6_HOST_INFO_BINDIR}/rcc")
|
||||||
|
if (WIN32)
|
||||||
|
string(APPEND rcc_binary_path ".exe")
|
||||||
|
endif()
|
||||||
|
file(TO_NATIVE_PATH "${rcc_binary_path}" rcc_binary_path_native)
|
||||||
|
string(APPEND file_contents
|
||||||
|
" \"rcc-binary\" : \"${rcc_binary_path_native}\",\n")
|
||||||
|
|
||||||
# Last item in json file
|
# Last item in json file
|
||||||
|
|
||||||
# base location of stdlibc++, will be suffixed by androiddeploy qt
|
# base location of stdlibc++, will be suffixed by androiddeploy qt
|
||||||
@ -226,7 +235,7 @@ function(qt6_android_add_apk_target target)
|
|||||||
set(should_add_to_global_apk TRUE)
|
set(should_add_to_global_apk TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(deployment_tool "${QT_HOST_PATH}/bin/androiddeployqt")
|
set(deployment_tool "${QT_HOST_PATH}/${QT6_HOST_INFO_BINDIR}/androiddeployqt")
|
||||||
set(apk_dir "$<TARGET_PROPERTY:${target},BINARY_DIR>/android-build")
|
set(apk_dir "$<TARGET_PROPERTY:${target},BINARY_DIR>/android-build")
|
||||||
add_custom_target(${target}_prepare_apk_dir
|
add_custom_target(${target}_prepare_apk_dir
|
||||||
DEPENDS ${target}
|
DEPENDS ${target}
|
||||||
|
@ -169,6 +169,7 @@ struct Options
|
|||||||
QString applicationBinary;
|
QString applicationBinary;
|
||||||
QString applicationArguments;
|
QString applicationArguments;
|
||||||
QString rootPath;
|
QString rootPath;
|
||||||
|
QString rccBinaryPath;
|
||||||
QStringList qmlImportPaths;
|
QStringList qmlImportPaths;
|
||||||
QStringList qrcFiles;
|
QStringList qrcFiles;
|
||||||
|
|
||||||
@ -1004,6 +1005,12 @@ bool readInputFile(Options *options)
|
|||||||
options->qmlImportScannerBinaryPath = qmlImportScannerBinaryPath.toString();
|
options->qmlImportScannerBinaryPath = qmlImportScannerBinaryPath.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const QJsonValue rccBinaryPath = jsonObject.value(QLatin1String("rcc-binary"));
|
||||||
|
if (!rccBinaryPath.isUndefined())
|
||||||
|
options->rccBinaryPath = rccBinaryPath.toString();
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const QJsonValue applicationBinary = jsonObject.value(QLatin1String("application-binary"));
|
const QJsonValue applicationBinary = jsonObject.value(QLatin1String("application-binary"));
|
||||||
if (applicationBinary.isUndefined()) {
|
if (applicationBinary.isUndefined()) {
|
||||||
@ -1963,7 +1970,14 @@ bool createRcc(const Options &options)
|
|||||||
if (options.verbose)
|
if (options.verbose)
|
||||||
fprintf(stdout, "Create rcc bundle.\n");
|
fprintf(stdout, "Create rcc bundle.\n");
|
||||||
|
|
||||||
QString rcc = options.qtInstallDirectory + QLatin1String("/bin/rcc");
|
|
||||||
|
QString rcc;
|
||||||
|
if (!options.rccBinaryPath.isEmpty()) {
|
||||||
|
rcc = options.rccBinaryPath;
|
||||||
|
} else {
|
||||||
|
rcc = options.qtInstallDirectory + QLatin1String("/bin/rcc");
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(Q_OS_WIN32)
|
#if defined(Q_OS_WIN32)
|
||||||
rcc += QLatin1String(".exe");
|
rcc += QLatin1String(".exe");
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user