diff mbox series

[ustream-ssl,02/12] cmake: fix linking when wolfSSL not in default paths

Message ID 20201210154134.794-3-ynezz@true.cz
State Accepted
Delegated to: Petr Štetiar
Headers show
Series fixes, improvements and CI | expand

Commit Message

Petr Štetiar Dec. 10, 2020, 3:41 p.m. UTC
Fixes following issue when wolfSSL libs are installed in different
paths:

 /usr/bin/ld: cannot find -lwolfssl

Signed-off-by: Petr Štetiar <ynezz@true.cz>
---
 CMakeLists.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 315aeb87c80b..42c7f1fb00de 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,9 +13,10 @@  IF(MBEDTLS)
   SET(SSL_LIB mbedtls mbedcrypto mbedx509 m)
 ELSEIF(WOLFSSL)
   ADD_DEFINITIONS(-DHAVE_WOLFSSL)
+  FIND_LIBRARY(wolfssl_library wolfssl)
   SET(SSL_SRC ustream-io-wolfssl.c ustream-openssl.c)
-  SET(SSL_LIB wolfssl m)
-  SET(CMAKE_REQUIRED_LIBRARIES "-lwolfssl -lm")
+  SET(SSL_LIB ${wolfssl_library} m)
+  SET(CMAKE_REQUIRED_LIBRARIES "${wolfssl_library} -lm")
   CHECK_SYMBOL_EXISTS (wolfSSL_SSLSetIORecv "wolfssl/ssl.h"
 		       HAVE_WOLFSSL_SSLSETIORECV)
   IF (NOT HAVE_WOLFSSL_SSLSETIORECV)