0001-src-CMakeLists.txt-fix-build-with-mbedtls-but-withou.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From 0982308255dd3fd70e7b93aa88a8f3c5b9c1b845 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sun, 30 Aug 2020 21:15:06 +0200
  4. Subject: [PATCH] src/CMakeLists.txt: fix build with mbedtls but without zlib
  5. Building with mbedtls but without zlib will result in the following
  6. build failure:
  7. -- Found MbedTLS: /home/peko/autobuild/instance-0/output-1/per-package/rtty/host/powerpc64-buildroot-linux-gnu/sysroot/usr/lib/libmbedtls.so (found version "2.16.7")
  8. -- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
  9. -- Select MbedTLS(PolarSSL) as the SSL backend
  10. CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  11. Please set them or make sure they are set and tested correctly in the CMake files:
  12. ZLIB_LIBRARY
  13. linked by target "rtty" in directory /home/peko/autobuild/instance-0/output-1/build/rtty-7.1.4/src
  14. -- Configuring incomplete, errors occurred!
  15. Fixes:
  16. - http://autobuild.buildroot.org/results/a0ebffe58bbf14cab74b7d2111d4d88a9c725273
  17. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  18. [Upstream status: https://github.com/zhaojh329/rtty/pull/77]
  19. ---
  20. src/CMakeLists.txt | 6 +++++-
  21. 1 file changed, 5 insertions(+), 1 deletion(-)
  22. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
  23. index 10f6626..d09e848 100644
  24. --- a/src/CMakeLists.txt
  25. +++ b/src/CMakeLists.txt
  26. @@ -77,7 +77,11 @@ else()
  27. elseif(RTTY_USE_MBEDTLS)
  28. set(SSL_NAME "MbedTLS(PolarSSL)")
  29. set(SSL_INC ${MBEDTLS_INCLUDE_DIR})
  30. - set(SSL_LIB ${MBEDTLS_LIBRARIES} ${ZLIB_LIBRARIES})
  31. + if(ZLIB_FOUND)
  32. + set(SSL_LIB ${MBEDTLS_LIBRARIES} ${ZLIB_LIBRARIES})
  33. + else()
  34. + set(SSL_LIB ${MBEDTLS_LIBRARIES})
  35. + endif()
  36. set(RTTY_HAVE_MBEDTLS_CONFIG 1)
  37. endif()
  38. --
  39. 2.28.0