-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
38 lines (35 loc) · 2.88 KB
/
CMakeLists.txt
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
27
28
29
30
31
32
33
34
35
36
37
38
if (NOT ANDROID)
message(FATAL_ERROR "Only Android is supported by this repository.")
endif()
message(STATUS "Using OpenSSL Android binary repository for ${ANDROID_ABI}.")
add_library(openssl-android-binary INTERFACE)
if (${ANDROID_ABI} STREQUAL "x86_64")
target_include_directories(openssl-android-binary INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/openssl-x86_64/include")
target_include_directories(openssl-android-binary INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/curl-x86_64/include")
target_link_directories(openssl-android-binary INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/openssl-x86_64/lib")
add_library(backtrace_libssl STATIC IMPORTED)
set_target_properties(backtrace_libssl PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/openssl-x86_64/lib/libssl.a")
add_library(backtrace_libcrypto STATIC IMPORTED)
set_target_properties(backtrace_libcrypto PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/openssl-x86_64/lib/libcrypto.a")
target_link_libraries(openssl-android-binary INTERFACE "backtrace_libssl" "backtrace_libcrypto")
elseif(${ANDROID_ABI} STREQUAL "arm64-v8a")
target_include_directories(openssl-android-binary INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/openssl-arm64-v8a/include")
target_include_directories(openssl-android-binary INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/curl-arm64-v8a/include")
target_link_directories(openssl-android-binary INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/openssl-arm64-v8a/lib")
add_library(backtrace_libssl STATIC IMPORTED)
set_target_properties(backtrace_libssl PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/openssl-arm64-v8a/lib/libssl.a")
add_library(backtrace_libcrypto STATIC IMPORTED)
set_target_properties(backtrace_libcrypto PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/openssl-arm64-v8a/lib/libcrypto.a")
target_link_libraries(openssl-android-binary INTERFACE "backtrace_libssl" "backtrace_libcrypto")
elseif(${ANDROID_ABI} STREQUAL "armeabi-v7a")
target_include_directories(openssl-android-binary INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/openssl-armeabi-v7a/include")
target_include_directories(openssl-android-binary INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/curl-armeabi-v7a/include")
target_link_directories(openssl-android-binary INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/openssl-armeabi-v7a/lib")
add_library(backtrace_libssl STATIC IMPORTED)
set_target_properties(backtrace_libssl PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/openssl-armeabi-v7a/lib/libssl.a")
add_library(backtrace_libcrypto STATIC IMPORTED)
set_target_properties(backtrace_libcrypto PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/openssl-armeabi-v7a/lib/libcrypto.a")
target_link_libraries(openssl-android-binary INTERFACE "backtrace_libssl" "backtrace_libcrypto")
else()
message(WARNING "${ANDROID_ABI} is not supported by the openssl-android-binary repository.")
endif()