cmake: Only build libcrypto and libcrypto-compat when needed

This also fixes the gcrypt build.

Cherry-picked from 2f6a866373

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2016-11-08 10:31:20 +01:00
parent 1642cec280
commit 0dd7a963a9
2 changed files with 4 additions and 9 deletions

View File

@@ -124,8 +124,6 @@ set(libssh_SRCS
kex.c
known_hosts.c
legacy.c
libcrypto.c
libcrypto-compat.c
log.c
match.c
messages.c
@@ -164,7 +162,11 @@ else (WITH_GCRYPT)
set(libssh_SRCS
${libssh_SRCS}
pki_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)

View File

@@ -7,9 +7,6 @@
* https://www.openssl.org/source/license.html
*/
#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#include <string.h>
#include <openssl/engine.h>
#include "libcrypto-compat.h"
@@ -317,7 +314,3 @@ int HMAC_CTX_reset(HMAC_CTX *ctx)
HMAC_CTX_init(ctx);
return 1;
}
#else
typedef int iso_c_forbids_an_empty_source_file;
#endif /* OPENSSL_VERSION_NUMBER */