From 76e4b13e7c0ac230b322b72f38807333d9139462 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 25 May 2021 16:34:16 +0200 Subject: [PATCH] CMake: Fix finalizers not being run for android executables Android executables are actually loadable modules, not executables. Instead of checking for the target type if it's a MODULE, be explicit and mark the target with a special qt property that we then use to decide whether the finalizer should run. Amends c4df673dd9034bc6dcd0871d27f13d8524ae829e Change-Id: I5330d80d39488cfda6ebe07e2a1883200a796be8 Reviewed-by: Joerg Bornemann --- src/corelib/Qt6CoreMacros.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index bbe07a93ff..6cba48dee7 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -518,6 +518,7 @@ function(_qt_internal_create_executable target) set_property(TARGET "${target}" PROPERTY OBJC_VISIBILITY_PRESET default) set_property(TARGET "${target}" PROPERTY OBJCXX_VISIBILITY_PRESET default) qt6_android_apply_arch_suffix("${target}") + set_property(TARGET "${target}" PROPERTY _qt_is_android_executable TRUE) else() add_executable("${target}" ${ARGN}) endif() @@ -606,7 +607,9 @@ function(qt6_finalize_target target) endif() get_target_property(target_type ${target} TYPE) - if(target_type STREQUAL "EXECUTABLE") + get_target_property(is_android_executable "${target}" _qt_is_android_executable) + + if(target_type STREQUAL "EXECUTABLE" OR is_android_executable) _qt_internal_finalize_executable(${ARGV}) endif() endfunction()