Android: Do not duplicate copy_if_different command for android target
The CMake copy_if_different command, which copies the android target library to a libs/<arch> directory could be executed in different code paths which caused a multiple access to a same file in a filesystem. Avoid doing this and depend on <target>_prepare_apk_dir target for the depfile code path too. Pick-to: 6.5 Change-Id: Ib62cf24ecc69a17ce1b52cd1f001aeff866051cd Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 76fef03f19ab2a41ec9fdc9a72a08b5e1ea80a95) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
b52a0f8e10
commit
97420aaa46
@ -524,9 +524,6 @@ function(qt6_android_add_apk_target target)
|
|||||||
# Add custom command that creates the apk and triggers rebuild if files listed in
|
# Add custom command that creates the apk and triggers rebuild if files listed in
|
||||||
# ${dep_file_path} are changed.
|
# ${dep_file_path} are changed.
|
||||||
add_custom_command(OUTPUT "${apk_final_file_path}"
|
add_custom_command(OUTPUT "${apk_final_file_path}"
|
||||||
COMMAND ${CMAKE_COMMAND}
|
|
||||||
-E copy "$<TARGET_FILE:${target}>"
|
|
||||||
"${apk_final_dir}/${target_file_copy_relative_path}"
|
|
||||||
COMMAND "${deployment_tool}"
|
COMMAND "${deployment_tool}"
|
||||||
--input "${deployment_file}"
|
--input "${deployment_file}"
|
||||||
--output "${apk_final_dir}"
|
--output "${apk_final_dir}"
|
||||||
@ -536,7 +533,7 @@ function(qt6_android_add_apk_target target)
|
|||||||
${extra_args}
|
${extra_args}
|
||||||
${sign_apk}
|
${sign_apk}
|
||||||
COMMENT "Creating APK for ${target}"
|
COMMENT "Creating APK for ${target}"
|
||||||
DEPENDS "${target}" "${deployment_file}" ${extra_deps}
|
DEPENDS "${target}" "${deployment_file}" ${extra_deps} ${target}_prepare_apk_dir
|
||||||
DEPFILE "${dep_file_path}"
|
DEPFILE "${dep_file_path}"
|
||||||
VERBATIM
|
VERBATIM
|
||||||
${uses_terminal}
|
${uses_terminal}
|
||||||
@ -545,9 +542,6 @@ function(qt6_android_add_apk_target target)
|
|||||||
# Add custom command that creates the aar and triggers rebuild if files listed in
|
# Add custom command that creates the aar and triggers rebuild if files listed in
|
||||||
# ${dep_file_path} are changed.
|
# ${dep_file_path} are changed.
|
||||||
add_custom_command(OUTPUT "${aar_final_file_path}"
|
add_custom_command(OUTPUT "${aar_final_file_path}"
|
||||||
COMMAND ${CMAKE_COMMAND}
|
|
||||||
-E copy "$<TARGET_FILE:${target}>"
|
|
||||||
"${apk_final_dir}/${target_file_copy_relative_path}"
|
|
||||||
COMMAND "${deployment_tool}"
|
COMMAND "${deployment_tool}"
|
||||||
--input "${deployment_file}"
|
--input "${deployment_file}"
|
||||||
--output "${apk_final_dir}"
|
--output "${apk_final_dir}"
|
||||||
@ -557,7 +551,7 @@ function(qt6_android_add_apk_target target)
|
|||||||
--build-aar
|
--build-aar
|
||||||
${extra_args}
|
${extra_args}
|
||||||
COMMENT "Creating AAR for ${target}"
|
COMMENT "Creating AAR for ${target}"
|
||||||
DEPENDS "${target}" "${deployment_file}" ${extra_deps}
|
DEPENDS "${target}" "${deployment_file}" ${extra_deps} ${target}_prepare_apk_dir
|
||||||
DEPFILE "${dep_file_path}"
|
DEPFILE "${dep_file_path}"
|
||||||
VERBATIM
|
VERBATIM
|
||||||
${uses_terminal}
|
${uses_terminal}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user