From 3f66c028fa396a3ac10a584ba205652a757e2d30 Mon Sep 17 00:00:00 2001 From: NO NAME <45446340+linwenchen@users.noreply.github.com> Date: Tue, 9 Apr 2024 17:51:31 +0800 Subject: [PATCH] Fix Cmake find issue in libevent (#1466) Fixed an issue in libevent's CMake configuration where pthreads were not correctly added to the optional components list, leading to a compilation error. #1448 Co-authored-by: linwenchen --- src/apps/common/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/apps/common/CMakeLists.txt b/src/apps/common/CMakeLists.txt index 12457901..66bbb6f9 100644 --- a/src/apps/common/CMakeLists.txt +++ b/src/apps/common/CMakeLists.txt @@ -40,6 +40,9 @@ endif() find_package(Libevent CONFIG) if(Libevent_FOUND) list(APPEND COMMON_LIBS libevent::core libevent::extra libevent::openssl) + if(NOT WIN32) + list(APPEND COMMON_LIBS libevent::pthreads) + endif() else() find_package(Libevent MODULE) if(Libevent_FOUND)