diff --git a/CMakeLists.txt b/CMakeLists.txt index 32c34b42..77166b34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -445,8 +445,13 @@ if(${OPENSSL}) if(WIN32 OR WIN64 OR MSVC) find_library(OpenSSL REQUIRED NAMES libssl PATHS ${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR} NO_DEFAULT_PATH) find_library(Crypto REQUIRED NAMES libcrypto PATHS ${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR} NO_DEFAULT_PATH) - else() - find_library(OpenSSL REQUIRED NAMES ssl PATHS ${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR} NO_DEFAULT_PATH) + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64") + # find_library doesn't work when building for Android architecture + set(OpenSSL "${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR}/libssl.a") + set(Crypto "${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR}/libcrypto.a") + link_libraries(${OpenSSL} ${Crypto}) + else() + find_library(OpenSSL REQUIRED NAMES ssl PATHS ${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR} NO_DEFAULT_PATH) find_library(Crypto REQUIRED NAMES crypto PATHS ${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR} NO_DEFAULT_PATH) endif() @@ -478,9 +483,15 @@ if(${OPENSSL}) ${CMAKE_CURRENT_LIST_DIR}/openssl/pbpal_openssl_blocking_io.c ${FEATURE_SOURCEFILES}) - set(FEATURE_SOURCEFILES - ${CMAKE_CURRENT_LIST_DIR}/openssl/pbauto_heartbeat_init_posix.c - ${FEATURE_SOURCEFILES}) + if(UNIX) + set(FEATURE_SOURCEFILES + ${CMAKE_CURRENT_LIST_DIR}/posix/pbauto_heartbeat_init_posix.c + ${FEATURE_SOURCEFILES}) + else() + set(FEATURE_SOURCEFILES + ${CMAKE_CURRENT_LIST_DIR}/windows/pbauto_heartbeat_init_windows.c + ${FEATURE_SOURCEFILES}) + endif() set(LDLIBS ${LDLIBS}) @@ -537,7 +548,7 @@ if(NOT ESP_PLATFORM) set(LIBTYPE SHARED) else() message(STATUS "Building static library") - set(LIBYTPE STATIC) + set(LIBTYPE STATIC) endif() add_library(pubnub ${LIBTYPE} ${SOURCEFILES}) diff --git a/openssl/pbauto_heartbeat_init_posix.c b/openssl/pbauto_heartbeat_init_posix.c deleted file mode 120000 index 8c8d7fa8..00000000 --- a/openssl/pbauto_heartbeat_init_posix.c +++ /dev/null @@ -1 +0,0 @@ -../posix/pbauto_heartbeat_init_posix.c \ No newline at end of file