-
Notifications
You must be signed in to change notification settings - Fork 152
/
android_openssl.cmake
26 lines (24 loc) · 1.02 KB
/
android_openssl.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function(add_android_openssl_libraries)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(ssl_root_path ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/no-asm)
else()
set(ssl_root_path ${CMAKE_CURRENT_FUNCTION_LIST_DIR})
endif()
if(Qt6_VERSION VERSION_GREATER_EQUAL 6.5.0)
if(NOT OPENSSL_ROOT_DIR)
set(OPENSSL_ROOT_DIR ${SSL_ROOT_PATH}/ssl_3/${CMAKE_ANDROID_ARCH_ABI})
endif()
list(APPEND android_extra_libs
${ssl_root_path}/ssl_3/${CMAKE_ANDROID_ARCH_ABI}/libcrypto_3.so
${ssl_root_path}/ssl_3/${CMAKE_ANDROID_ARCH_ABI}/libssl_3.so)
else()
if(NOT OPENSSL_ROOT_DIR)
set(OPENSSL_ROOT_DIR ${SSL_ROOT_PATH}/ssl_1.1/${CMAKE_ANDROID_ARCH_ABI})
endif()
list(APPEND android_extra_libs
${ssl_root_path}/ssl_1.1/${CMAKE_ANDROID_ARCH_ABI}/libcrypto_1_1.so
${ssl_root_path}/ssl_1.1/${CMAKE_ANDROID_ARCH_ABI}/libssl_1_1.so)
endif()
set_target_properties(${ARGN} PROPERTIES QT_ANDROID_EXTRA_LIBS
"${android_extra_libs}")
endfunction()