From 18e62ed3b73849ea985f592fea10255de8bd440c Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Wed, 29 Dec 2021 16:41:08 +0100 Subject: [PATCH] Pass QT_BUILD_STANDALONE_TESTS to Android external project if defined If we configure qtbase standalone tests for multiple Android ABIs, external project also needs the QT_BUILD_STANDALONE_TESTS flag enabled to avoid configuring the whole qtbase but not only tests. TODO: Need to forward all cache variables that are defined by user to the external project since otherwise the configuration of the external project will differ. Created QTBUG-99537 to track this. Pick-to: 6.3 Change-Id: I3aec1391c850fb37696dc50416e0ff2a2646e759 Reviewed-by: Joerg Bornemann --- src/corelib/Qt6AndroidMacros.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index 25599c1af32..22e3ca614dc 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -884,6 +884,13 @@ function(_qt_internal_configure_android_multiabi_target target) else() set(config_arg "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") endif() + + # The flag is needed when building qt standalone tests only to avoid building + # qt repo itself + if(QT_BUILD_STANDALONE_TESTS) + list(APPEND extra_cmake_args "-DQT_BUILD_STANDALONE_TESTS=ON") + endif() + set(android_abi_build_dir "${CMAKE_BINARY_DIR}/android_abi_builds/${abi}") get_property(abi_external_projects GLOBAL PROPERTY _qt_internal_abi_external_projects) @@ -899,6 +906,7 @@ function(_qt_internal_configure_android_multiabi_target target) "-DQT_IS_ANDROID_MULTI_ABI_EXTERNAL_PROJECT=ON" "-DQT_INTERNAL_ANDROID_MULTI_ABI_BINARY_DIR=${CMAKE_BINARY_DIR}" "${config_arg}" + "${extra_cmake_args}" EXCLUDE_FROM_ALL TRUE BUILD_COMMAND "" # avoid top-level build of external project )