From 507b4f5a624c37a9bd79ff1bc3b788d4b9848014 Mon Sep 17 00:00:00 2001 From: Christoph Fritz Date: Sat, 1 Apr 2023 20:11:13 +0200 Subject: [PATCH] tls: cmake: avoid using full host path for SSL lib When using OE/Yocto to create a SDK/toolchain, the generated LibwebsocketsTargets.cmake falsely contains the host path (build artifacts) in INTERFACE_LINK_LIBRARIES instead of the actually installed SDK path. This host path originates from OPENSSL_LIBRARIES that gives the full path to the openssl library at build time. To avoid propagating full build host specific path to generated LibwebsocketsTargets.cmake, this patch forces to link with ssl and crypto instead of a full path. --- lib/tls/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/tls/CMakeLists.txt b/lib/tls/CMakeLists.txt index a2b78c252..4cf5e8196 100644 --- a/lib/tls/CMakeLists.txt +++ b/lib/tls/CMakeLists.txt @@ -267,8 +267,7 @@ if (LWS_WITH_SSL) find_package(PkgConfig QUIET) pkg_check_modules(PC_OPENSSL openssl QUIET) find_package(OpenSSL REQUIRED) - list(APPEND OPENSSL_LIBRARIES ${PC_OPENSSL_LIBRARIES}) - set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} PARENT_SCOPE) + set(OPENSSL_LIBRARIES ${PC_OPENSSL_LIBRARIES}) endif() set(OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}") endif()