summaryrefslogtreecommitdiffstats
path: root/cmake/QtTestHelpers.cmake
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2023-07-04 12:17:27 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2023-07-06 21:25:51 +0200
commit20d3827ecca29f46ce147d519274942e5ca33263 (patch)
treeb676f2df0cb9042c26a1ede4881a839752b7f468 /cmake/QtTestHelpers.cmake
parentdfddde0b53b82192f01e43536a2e53aa005a363b (diff)
Android[openssl]: Check existence of OpenSSL .so file before use
VCPKG by default does static builds when building for Android. This is at odds with the bundling-concept, so it should not be done unconditionally. Since we don't necessarily have the WrapOpenSSL target on-hand, let's just do a file-exists test for the one of the paths we would include. Pick-to: 6.6 6.5 Change-Id: I3693354308d5168d8a9c3d1659bfa51540114b7f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'cmake/QtTestHelpers.cmake')
-rw-r--r--cmake/QtTestHelpers.cmake11
1 files changed, 8 insertions, 3 deletions
diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake
index 1edb412908..4978f95538 100644
--- a/cmake/QtTestHelpers.cmake
+++ b/cmake/QtTestHelpers.cmake
@@ -585,9 +585,14 @@ function(qt_internal_add_test name)
message(WARNING "The argument BUNDLE_ANDROID_OPENSSL_LIBS is set "
"but OPENSSL_ROOT_DIR parameter is not set.")
else()
- set_property(TARGET ${name} APPEND PROPERTY QT_ANDROID_EXTRA_LIBS
- "${OPENSSL_ROOT_DIR}/${CMAKE_ANDROID_ARCH_ABI}/libcrypto_3.so"
- "${OPENSSL_ROOT_DIR}/${CMAKE_ANDROID_ARCH_ABI}/libssl_3.so")
+ if(EXISTS "${OPENSSL_ROOT_DIR}/${CMAKE_ANDROID_ARCH_ABI}/libcrypto_3.so")
+ set_property(TARGET ${name} APPEND PROPERTY QT_ANDROID_EXTRA_LIBS
+ "${OPENSSL_ROOT_DIR}/${CMAKE_ANDROID_ARCH_ABI}/libcrypto_3.so"
+ "${OPENSSL_ROOT_DIR}/${CMAKE_ANDROID_ARCH_ABI}/libssl_3.so")
+ else()
+ message(STATUS "Test should bundle OpenSSL libraries but they are not found."
+ " This is fine if OpenSSL was built statically.")
+ endif()
endif()
endif()
qt_internal_android_test_arguments("${name}" test_executable extra_test_args)