mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-09 15:41:10 +03:00
cmake: remove fallback for crypto lib lookup
because if a fallback happens, the WITH_(GCRYPT|MBEDTLS) variables do not match the selection, anymore. Also a silent fallback is pretty bad if it is unnoticed. Signed-off-by: Gregor Jasny <gjasny@googlemail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Jakub Jelen
parent
ff111a4a8b
commit
486d2289fa
@@ -49,32 +49,16 @@ endif (WITH_ZLIB)
|
|||||||
|
|
||||||
if (WITH_GCRYPT)
|
if (WITH_GCRYPT)
|
||||||
find_package(GCrypt 1.5.0 REQUIRED)
|
find_package(GCrypt 1.5.0 REQUIRED)
|
||||||
if (NOT GCRYPT_FOUND)
|
|
||||||
message(FATAL_ERROR "Could not find GCrypt")
|
|
||||||
endif (NOT GCRYPT_FOUND)
|
|
||||||
elseif(WITH_MBEDTLS)
|
elseif(WITH_MBEDTLS)
|
||||||
find_package(MbedTLS REQUIRED)
|
find_package(MbedTLS REQUIRED)
|
||||||
if (NOT MBEDTLS_FOUND)
|
else()
|
||||||
message(FATAL_ERROR "Could not find mbedTLS")
|
find_package(OpenSSL 1.1.1 REQUIRED)
|
||||||
endif (NOT MBEDTLS_FOUND)
|
# On CMake < 3.16, OPENSSL_CRYPTO_LIBRARIES is usually a synonym for OPENSSL_CRYPTO_LIBRARY, but is not defined
|
||||||
else (WITH_GCRYPT)
|
# when building on Windows outside of Cygwin. We provide the synonym here, if FindOpenSSL didn't define it already.
|
||||||
find_package(OpenSSL 1.1.1)
|
if (NOT DEFINED OPENSSL_CRYPTO_LIBRARIES)
|
||||||
if (OPENSSL_FOUND)
|
set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
|
||||||
# On CMake < 3.16, OPENSSL_CRYPTO_LIBRARIES is usually a synonym for OPENSSL_CRYPTO_LIBRARY, but is not defined
|
endif (NOT DEFINED OPENSSL_CRYPTO_LIBRARIES)
|
||||||
# when building on Windows outside of Cygwin. We provide the synonym here, if FindOpenSSL didn't define it already.
|
endif()
|
||||||
if (NOT DEFINED OPENSSL_CRYPTO_LIBRARIES)
|
|
||||||
set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
|
|
||||||
endif (NOT DEFINED OPENSSL_CRYPTO_LIBRARIES)
|
|
||||||
else (OPENSSL_FOUND)
|
|
||||||
find_package(GCrypt)
|
|
||||||
if (NOT GCRYPT_FOUND)
|
|
||||||
find_package(MbedTLS)
|
|
||||||
if (NOT MBEDTLS_FOUND)
|
|
||||||
message(FATAL_ERROR "Could not find OpenSSL, GCrypt or mbedTLS")
|
|
||||||
endif (NOT MBEDTLS_FOUND)
|
|
||||||
endif (NOT GCRYPT_FOUND)
|
|
||||||
endif (OPENSSL_FOUND)
|
|
||||||
endif(WITH_GCRYPT)
|
|
||||||
|
|
||||||
if (UNIT_TESTING)
|
if (UNIT_TESTING)
|
||||||
find_package(CMocka REQUIRED)
|
find_package(CMocka REQUIRED)
|
||||||
|
|||||||
Reference in New Issue
Block a user