Skip to content
Permalink
Browse files

Add all our backend's sources when building

  • Loading branch information...
tiennou committed Apr 18, 2019
1 parent 718ae12 commit 50ed0a9af33d25144658e9068fe4e48bc0fa0127
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/CMakeLists.txt
@@ -58,13 +58,18 @@ if(CRYPTO_BACKEND)
set(SPECIFIC_CRYPTO_REQUIREMENT REQUIRED)
endif()

set(CRYPTO_SOURCES openssl.c openssl.h
libgcrypt.c libgcrypt.h
mbedtls.c mbedtls.h
wincng.c wincng.h
)

if(CRYPTO_BACKEND STREQUAL "OpenSSL" OR NOT CRYPTO_BACKEND)

find_package(OpenSSL ${SPECIFIC_CRYPTO_REQUIREMENT})

if(OPENSSL_FOUND)
set(CRYPTO_BACKEND "OpenSSL")
set(CRYPTO_SOURCES openssl.c openssl.h)
list(APPEND PRIVATE_COMPILE_DEFINITIONS LIBSSH2_OPENSSL)
list(APPEND PRIVATE_INCLUDE_DIRECTORIES ${OPENSSL_INCLUDE_DIR})
list(APPEND LIBRARIES ${OPENSSL_LIBRARIES})
@@ -113,7 +118,6 @@ if(CRYPTO_BACKEND STREQUAL "Libgcrypt" OR NOT CRYPTO_BACKEND)

if(LIBGCRYPT_FOUND)
set(CRYPTO_BACKEND "Libgcrypt")
set(CRYPTO_SOURCES libgcrypt.c libgcrypt.h)
list(APPEND PRIVATE_COMPILE_DEFINITIONS LIBSSH2_LIBGCRYPT)
list(APPEND PRIVATE_INCLUDE_DIRECTORIES ${LIBGCRYPT_INCLUDE_DIRS})
list(APPEND LIBRARIES ${LIBGCRYPT_LIBRARIES})
@@ -128,7 +132,6 @@ if(CRYPTO_BACKEND STREQUAL "WinCNG" OR NOT CRYPTO_BACKEND)

if(HAVE_BCRYPT_H)
set(CRYPTO_BACKEND "WinCNG")
set(CRYPTO_SOURCES wincng.c wincng.h)
list(APPEND PRIVATE_COMPILE_DEFINITIONS LIBSSH2_WINCNG)

set(HAVE_LIBCRYPT32 TRUE)

0 comments on commit 50ed0a9

Please sign in to comment.
You can’t perform that action at this time.