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 <joerg.bornemann@qt.io>
This commit is contained in:
Alexey Edelev 2021-12-29 16:41:08 +01:00
parent d62463305d
commit 18e62ed3b7

View File

@ -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
)