aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKevin Kane <kkane@microsoft.com>2020-11-03 11:03:29 -0800
committerAndreas Schneider <asn@cryptomilk.org>2020-12-10 19:38:59 +0100
commita0e19239b8015f76fcc8ddfbdf496bd0f83acb21 (patch)
tree572e80892cff2fc94dbb282678d43948978f9328 /src
parentb36a5988bee0f86d1d7fa89e04eab11769d8c4d5 (diff)
downloadlibssh-a0e19239b8015f76fcc8ddfbdf496bd0f83acb21.tar.gz
libssh-a0e19239b8015f76fcc8ddfbdf496bd0f83acb21.tar.xz
libssh-a0e19239b8015f76fcc8ddfbdf496bd0f83acb21.zip
Use OPENSSL_CRYPTO_LIBRARIES CMake variable when linking against OpenSSL
The build currently breaks when attempting to link libssh.so using a statically-linked OpenSSL. -ldl and -lpthread are required when linking a binary with the static libcrypto.a. The OPENSSL_CRYPTO_LIBRARY does not include these dependencies when linking against static OpenSSL. OPENSSL_CRYPTO_LIBRARIES contains the correct dependencies in both static and shared configurations; -ldl and -lpthread are not required when linking against shared libcrypto.so. This change changes all uses of OPENSSL_CRYPTO_LIBRARY to OPENSSL_CRYPTO_LIBRARIES to let the FindOpenSSL CMake module always provide the correct libraries at link time. Signed-off-by: Kevin Kane <kkane@microsoft.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 621f8b35..dd765de1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -16,7 +16,7 @@ if (WIN32)
)
endif (WIN32)
-if (OPENSSL_CRYPTO_LIBRARY)
+if (OPENSSL_CRYPTO_LIBRARIES)
set(LIBSSH_PRIVATE_INCLUDE_DIRS
${LIBSSH_PRIVATE_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIR}
@@ -24,9 +24,9 @@ if (OPENSSL_CRYPTO_LIBRARY)
set(LIBSSH_LINK_LIBRARIES
${LIBSSH_LINK_LIBRARIES}
- ${OPENSSL_CRYPTO_LIBRARY}
+ ${OPENSSL_CRYPTO_LIBRARIES}
)
-endif (OPENSSL_CRYPTO_LIBRARY)
+endif (OPENSSL_CRYPTO_LIBRARIES)
if (MBEDTLS_CRYPTO_LIBRARY)
set(LIBSSH_PRIVATE_INCLUDE_DIRS