Browse Source

[build] adjust crypto vars in src/CMakeLists.txt

use different vars for different crypto libs
master
Glenn Strauss 1 month ago
parent
commit
f680e1b234
1 changed files with 6 additions and 7 deletions
  1. +6
    -7
      src/CMakeLists.txt

+ 6
- 7
src/CMakeLists.txt View File

@ -365,8 +365,8 @@ if(WITH_WOLFSSL)
unset(CHECK_HAVE_LIGHTY)
set(CMAKE_REQUIRED_LIBRARIES ${WOLFSSL_LIBRARY})
check_library_exists(${WOLFSSL_LIBRARY} wolfSSL_Init "" HAVE_LIBCRYPTO)
if(HAVE_LIBCRYPTO)
check_library_exists(${WOLFSSL_LIBRARY} wolfSSL_Init "" HAVE_LIBWOLFSSL)
if(HAVE_LIBWOLFSSL)
set(CRYPTO_LIBRARY ${WOLFSSL_LIBRARY})
add_definitions(-DHAVE_WOLFSSL_SSL_H)
set(HAVE_WOLFSSL 1)
@ -384,10 +384,9 @@ endif()
if(WITH_MBEDTLS)
check_include_files(mbedtls/ssl.h HAVE_MBEDTLS_SSL_H)
if(HAVE_MBEDTLS_SSL_H)
check_library_exists(mbedcrypto mbedtls_base64_encode "" HAVE_LIBCRYPTO)
if(HAVE_LIBCRYPTO)
check_library_exists(mbedcrypto mbedtls_base64_encode "" HAVE_LIBMBEDCRYPTO)
if(HAVE_LIBMBEDCRYPTO)
set(CRYPTO_LIBRARY mbedcrypto)
set(HAVE_LIBMBEDCRYPTO 1)
check_library_exists(mbedtls mbedtls_cipher_info_from_type "" HAVE_LIBMBEDTLS)
if(HAVE_LIBMBEDTLS)
check_library_exists(mbedx509 mbedtls_x509_get_name "" HAVE_LIBMBEDX509)
@ -434,8 +433,8 @@ if(WITH_NETTLE)
set(CMAKE_REQUIRED_INCLUDES)
endif()
if(HAVE_NETTLE_NETTLE_TYPES_H)
check_library_exists(nettle nettle_md5_init "" HAVE_LIBCRYPTO)
if(HAVE_LIBCRYPTO)
check_library_exists(nettle nettle_md5_init "" HAVE_LIBNETTLE)
if(HAVE_LIBNETTLE)
set(CRYPTO_LIBRARY nettle)
endif()
endif()


Loading…
Cancel
Save