diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-10-28 16:10:49 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-10-29 08:57:44 +0100 |
commit | 82ee87b7b83746bcc3d13af72979d0dca4c2de3d (patch) | |
tree | 7163118db3d8271fa046da86bf262b239fd7a3fc /src/corelib | |
parent | 11acbc2c9928603dae6b4e2f1ca8b745e766f92b (diff) |
CMake: Fix androiddeployqt support when using add_library MODULE
The recent change to support android with CMake assumes that the user
project will have add_library(foo SHARED), and sets the
CMAKE_SHARED_LIBRARY_SUFFIX_CXX variable to modify the final library
name to contain an ABI suffix.
This did not work when using add_library(foo MODULE), and
androiddeployqt failed saying it can't find the application binary.
Make sure to apply the ABI suffix to MODULE targets. Also cover
the suffix to be added regardless if the language used for compiling
the SO is C or C++.
Amends 52c799ed4425076df4353c02950ea1444fe5f102
Change-Id: Ic44d67e33a123bd0104d98b368ceda0844474980
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/Qt5AndroidSupport.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/Qt5AndroidSupport.cmake b/src/corelib/Qt5AndroidSupport.cmake index 4bf826eedc..5f24fb0e8c 100644 --- a/src/corelib/Qt5AndroidSupport.cmake +++ b/src/corelib/Qt5AndroidSupport.cmake @@ -168,6 +168,9 @@ if (NOT ${PROJECT_NAME}-MultiAbiBuild) -D CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=${CMAKE_FIND_ROOT_PATH_MODE_INCLUDE} -D CMAKE_FIND_ROOT_PATH_MODE_PACKAGE=${CMAKE_FIND_ROOT_PATH_MODE_PACKAGE} -D CMAKE_SHARED_LIBRARY_SUFFIX_CXX=_${android_abi}.so + -D CMAKE_SHARED_MODULE_SUFFIX_CXX=_${android_abi}.so + -D CMAKE_SHARED_LIBRARY_SUFFIX_C=_${android_abi}.so + -D CMAKE_SHARED_MODULE_SUFFIX_C=_${android_abi}.so -D CMAKE_LIBRARY_OUTPUT_DIRECTORY=${CMAKE_BINARY_DIR}/android-build/libs/${android_abi} -D ${PROJECT_NAME}-MultiAbiBuild=ON ) @@ -181,7 +184,10 @@ if (NOT ${PROJECT_NAME}-MultiAbiBuild) else() # For the default abi just use the regular cmake run, to have # nice IDE integration and so on + set(CMAKE_SHARED_MODULE_SUFFIX_CXX "_${ANDROID_ABI}.so") set(CMAKE_SHARED_LIBRARY_SUFFIX_CXX "_${ANDROID_ABI}.so") + set(CMAKE_SHARED_MODULE_SUFFIX_C "_${ANDROID_ABI}.so") + set(CMAKE_SHARED_LIBRARY_SUFFIX_C "_${ANDROID_ABI}.so") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/android-build/libs/${ANDROID_ABI}) endif() endforeach() |