diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2021-12-29 18:00:52 +0100 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2022-02-10 18:09:43 +0100 |
commit | aa2ee036e8948fc67b0095e032ab2a56c296fc62 (patch) | |
tree | e086d6090f72c2f2c36d6a3447c87c4610bdee68 /src/corelib/Qt6AndroidMacros.cmake | |
parent | e67c803fa9c1399ac819041ead77924aff24bbf2 (diff) |
Use 'copy' but not 'copy_if_different' on Windows platforms
Use custom script to copy big Android artifacts on Windows platforms.
The script uses 'copy' but not 'copy_if_different' when source file
size is bigger than 2GB. 'cmake -E copy_if_different' only compares
first 2GB of files because of cmake issue, so this step only
workaround the problem.
Task-number: QTBUG-99491
Change-Id: Id076734700e334dfc3330da412462c2b53829b33
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 2201934efa1b9889d474347e705784bf6925e120)
Diffstat (limited to 'src/corelib/Qt6AndroidMacros.cmake')
-rw-r--r-- | src/corelib/Qt6AndroidMacros.cmake | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index 56faedb121..21544e899f 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -358,11 +358,13 @@ function(qt6_android_add_apk_target target) # in case DEPFILEs are not supported. # Also the target is used to copy the library that belongs to ${target} when building multi-abi # apk to the abi-specific directory. + _qt_internal_copy_file_if_different_command(copy_command + "$<TARGET_FILE:${target}>" + "${apk_final_dir}/${target_file_copy_relative_path}" + ) add_custom_target(${target}_prepare_apk_dir ALL DEPENDS ${target} ${extra_deps} - COMMAND ${CMAKE_COMMAND} - -E copy_if_different $<TARGET_FILE:${target}> - "${apk_final_dir}/${target_file_copy_relative_path}" + COMMAND ${copy_command} COMMENT "Copying ${target} binary to apk folder" ) @@ -455,6 +457,10 @@ function(qt6_android_add_apk_target target) file(RELATIVE_PATH androiddeployqt_output_path "${CMAKE_BINARY_DIR}" "${apk_final_dir}") set(androiddeployqt_output_path "${QT_INTERNAL_ANDROID_MULTI_ABI_BINARY_DIR}/${androiddeployqt_output_path}") + _qt_internal_copy_file_if_different_command(copy_command + "$<TARGET_FILE:${target}>" + "${androiddeployqt_output_path}/${target_file_copy_relative_path}" + ) if(has_depfile_support) set(deploy_android_deps_dir "${apk_final_dir}/${target}_deploy_android") set(timestamp_file "${deploy_android_deps_dir}/timestamp") @@ -463,9 +469,7 @@ function(qt6_android_add_apk_target target) DEPENDS ${target} ${extra_deps} COMMAND ${CMAKE_COMMAND} -E make_directory "${deploy_android_deps_dir}" COMMAND ${CMAKE_COMMAND} -E touch "${timestamp_file}" - COMMAND ${CMAKE_COMMAND} - -E copy_if_different $<TARGET_FILE:${target}> - "${androiddeployqt_output_path}/${target_file_copy_relative_path}" + COMMAND ${copy_command} COMMAND ${deployment_tool} --input ${deployment_file} --output ${androiddeployqt_output_path} @@ -481,9 +485,7 @@ function(qt6_android_add_apk_target target) else() add_custom_target(qt_internal_${target}_copy_apk_dependencies DEPENDS ${target} ${extra_deps} - COMMAND ${CMAKE_COMMAND} - -E copy_if_different $<TARGET_FILE:${target}> - "${androiddeployqt_output_path}/${target_file_copy_relative_path}" + COMMAND ${copy_command} COMMAND ${deployment_tool} --input ${deployment_file} --output ${androiddeployqt_output_path} |