Add _make_aab target
Add target triggering AAB creation. Since the _make_aab target is not added to the ALL set, we may avoid dependency check for it and admit that the target is "always out of date". [ChangeLog][Android][Platform Specific Changes] Add the extra _make_aab targets for each executable target, that can be used to generate android app bundles. Also add aab metatarget to build all _make_aab targets that are created in the project. Pick-to: 6.2 Fixes: QTBUG-96710 Change-Id: I3b0c7fbb5a7dd493ca7a124c4e4b91fd857386bd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
54536bb5ae
commit
d162ce3732
@ -117,7 +117,7 @@ if(NOT QT_BUILD_STANDALONE_TESTS)
|
||||
# Needed when building qtbase for android.
|
||||
if(ANDROID)
|
||||
include(src/corelib/Qt6AndroidMacros.cmake)
|
||||
_qt_internal_create_global_apk_target()
|
||||
_qt_internal_create_global_android_targets()
|
||||
endif()
|
||||
|
||||
if(WASM)
|
||||
|
@ -322,9 +322,10 @@ function(qt6_android_add_apk_target target)
|
||||
message(FATAL_ERROR "Target ${target} is not a valid android executable target\n")
|
||||
endif()
|
||||
|
||||
# Make global apk target depend on the current apk target.
|
||||
# Make global apk and aab targets depend on the current apk target.
|
||||
if(TARGET apk)
|
||||
add_dependencies(apk ${target}_make_apk)
|
||||
add_dependencies(aab ${target}_make_aab)
|
||||
_qt_internal_create_global_apk_all_target_if_needed()
|
||||
endif()
|
||||
|
||||
@ -407,19 +408,44 @@ function(qt6_android_add_apk_target target)
|
||||
COMMENT "Creating APK for ${target}"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Add target triggering AAB creation. Since the _make_aab target is not added to the ALL
|
||||
# set, we may avoid dependency check for it and admit that the target is "always out
|
||||
# of date".
|
||||
add_custom_target(${target}_make_aab
|
||||
DEPENDS ${target}_prepare_apk_dir
|
||||
COMMAND ${deployment_tool}
|
||||
--input ${deployment_file}
|
||||
--output ${apk_final_dir}
|
||||
--apk ${apk_final_file_path}
|
||||
--aab
|
||||
${extra_args}
|
||||
COMMENT "Creating AAB for ${target}"
|
||||
)
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY _qt_apk_targets ${target})
|
||||
_qt_internal_collect_target_apk_dependencies_defer(${target})
|
||||
endfunction()
|
||||
|
||||
function(_qt_internal_create_global_apk_target)
|
||||
function(_qt_internal_create_global_android_targets)
|
||||
macro(_qt_internal_create_global_android_targets_impl target)
|
||||
string(TOUPPER "${target}" target_upper)
|
||||
if(NOT QT_NO_GLOBAL_${target_upper}_TARGET)
|
||||
if(NOT TARGET ${target})
|
||||
add_custom_target(${target} COMMENT "Building all apks")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Create a top-level "apk" target for convenience, so that users can call 'ninja apk'.
|
||||
# It will trigger building all the apk build targets that are added as part of the project.
|
||||
# Allow opting out.
|
||||
if(NOT QT_NO_GLOBAL_APK_TARGET)
|
||||
if(NOT TARGET apk)
|
||||
add_custom_target(apk COMMENT "Building all apks")
|
||||
endif()
|
||||
endif()
|
||||
_qt_internal_create_global_android_targets_impl(apk)
|
||||
|
||||
# Create a top-level "aab" target for convenience, so that users can call 'ninja aab'.
|
||||
# It will trigger building all the apk build targets that are added as part of the project.
|
||||
# Allow opting out.
|
||||
_qt_internal_create_global_android_targets_impl(aab)
|
||||
endfunction()
|
||||
|
||||
# The function collects all known non-imported shared libraries that are created in the build tree.
|
||||
|
@ -46,7 +46,7 @@ set(_Qt6CTestMacros "${_Qt6CoreConfigDir}/Qt6CTestMacros.cmake")
|
||||
|
||||
if(ANDROID_PLATFORM)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@QT_CMAKE_EXPORT_NAMESPACE@AndroidMacros.cmake")
|
||||
_qt_internal_create_global_apk_target()
|
||||
_qt_internal_create_global_android_targets()
|
||||
_qt_internal_collect_default_android_abis()
|
||||
endif()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user