From 2f6a8663731668649499142460f648c687c0f5d3 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 8 Nov 2016 10:31:20 +0100 Subject: cmake: Only build libcrypto and libcrypto-compat when needed This also fixes the gcrypt build. Signed-off-by: Andreas Schneider --- src/CMakeLists.txt | 6 ++++-- src/libcrypto-compat.c | 7 ------- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3c22dfac..e5a93538 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -125,8 +125,6 @@ set(libssh_SRCS kex.c known_hosts.c legacy.c - libcrypto.c - libcrypto-compat.c log.c match.c messages.c @@ -167,7 +165,11 @@ else (WITH_GCRYPT) ${libssh_SRCS} pki_crypto.c ecdh_crypto.c + libcrypto.c ) + if(OPENSSL_VERSION VERSION_LESS "1.1.0") + set(libssh_SRCS ${libssh_SRCS} libcrypto-compat.c) + endif() endif (WITH_GCRYPT) if (WITH_SFTP) diff --git a/src/libcrypto-compat.c b/src/libcrypto-compat.c index 1f27dd5f..e0c95ff2 100644 --- a/src/libcrypto-compat.c +++ b/src/libcrypto-compat.c @@ -7,9 +7,6 @@ * https://www.openssl.org/source/license.html */ -#include -#if OPENSSL_VERSION_NUMBER < 0x10100000L - #include #include #include "libcrypto-compat.h" @@ -329,7 +326,3 @@ void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx) EVP_CIPHER_CTX_init(ctx); OPENSSL_free(ctx); } - -#else -typedef int iso_c_forbids_an_empty_source_file; -#endif /* OPENSSL_VERSION_NUMBER */ -- cgit v1.2.3