From 53ffa665d0aba0675dccd2876257ba0e4375dd25 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Wed, 27 Oct 2021 13:34:46 +0200 Subject: [PATCH] Fix target existence check in qt6_android_generate_deployment_settings Move the check to the beginning of the function. Pick-to: 6.2 Change-Id: Ia44bb2e56626b00e75efabf2ebdc8eb97eee0ff8 Reviewed-by: Alexandru Croitor Reviewed-by: Craig Scott --- src/corelib/Qt6AndroidMacros.cmake | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index 74f5fc1913..58343d998c 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -19,6 +19,11 @@ endfunction() # Generate the deployment settings json file for a cmake target. function(qt6_android_generate_deployment_settings target) + # Information extracted from mkspecs/features/android/android_deployment_settings.prf + if (NOT TARGET ${target}) + message(FATAL_ERROR "${target} is not a cmake target") + endif() + # When parsing JSON file format backslashes and follow up symbols are regarded as special # characters. This puts Windows path format into a trouble. # _qt_internal_android_format_deployment_paths converts sensitive paths to the CMake format @@ -36,12 +41,6 @@ function(qt6_android_generate_deployment_settings target) _qt_is_android_generate_deployment_settings_called TRUE ) - # Information extracted from mkspecs/features/android/android_deployment_settings.prf - if (NOT TARGET ${target}) - message(SEND_ERROR "${target} is not a cmake target") - return() - endif() - get_target_property(target_type ${target} TYPE) if (NOT "${target_type}" STREQUAL "MODULE_LIBRARY")