summaryrefslogtreecommitdiff
path: root/src/corelib
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2022-10-24 14:09:09 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-10-26 12:48:51 +0000
commitdf8ef042291b1fd35eaad0856b6b4b6dd0ce3275 (patch)
tree63fcf6021e799ace1dec28f487b99d98c4f03533 /src/corelib
parent6b2bd76fca7703328af88b2695110757398e5a58 (diff)
downloadqtbase-df8ef042291b1fd35eaad0856b6b4b6dd0ce3275.tar.gz
Specify source and build directory explicitly for multi-ABI external projects
When building Android multi-ABI application in source tree the ExternalProject_Add call generates a ninja rule that looks as follows: cd <BINARY_DIR> && cmake <CMAKE_ARGS> <SOURCE_DIR> In general case the rule works correctly unless SOURCE_DIR contains CMakeCache.txt. In this case the cmake call uses the existing CMakeCache.txt as the reference and tries to reuse the build directory of the main ABI. It leads to the inconsistency for multi-ABI builds and rewriting CMakeCache.txt. Passing both '-B' and '-S' arguments explicitly avoids using CMakeCache.txt from a main build/source directory and fixes in-source multi-ABI builds. Fixes: QTBUG-107843 Change-Id: I010b47bff81052401aebe459e7893838a9b99bc1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 97007e1aced516e178b8b6891b5fd1a4d26af2bb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/Qt6AndroidMacros.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake
index 8e1543752e..9424053743 100644
--- a/src/corelib/Qt6AndroidMacros.cmake
+++ b/src/corelib/Qt6AndroidMacros.cmake
@@ -1016,13 +1016,17 @@ function(_qt_internal_configure_android_multiabi_target target)
ExternalProject_Add("qt_internal_android_${abi}"
SOURCE_DIR "${CMAKE_SOURCE_DIR}"
BINARY_DIR "${android_abi_build_dir}"
- CMAKE_ARGS
+ CONFIGURE_COMMAND
+ "${CMAKE_COMMAND}"
+ "-G${CMAKE_GENERATOR}"
"-DCMAKE_TOOLCHAIN_FILE=${qt_abi_toolchain_path}"
"-DQT_HOST_PATH=${QT_HOST_PATH}"
"-DQT_IS_ANDROID_MULTI_ABI_EXTERNAL_PROJECT=ON"
"-DQT_INTERNAL_ANDROID_MULTI_ABI_BINARY_DIR=${CMAKE_BINARY_DIR}"
"${config_arg}"
"${extra_cmake_args}"
+ "-B" "${android_abi_build_dir}"
+ "-S" "${CMAKE_SOURCE_DIR}"
EXCLUDE_FROM_ALL TRUE
BUILD_COMMAND "" # avoid top-level build of external project
)