Browse Source

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 <[email protected]>
NO NAME 1 year ago
parent
commit
3f66c028fa
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/apps/common/CMakeLists.txt

+ 3 - 0
src/apps/common/CMakeLists.txt

@@ -40,6 +40,9 @@ endif()
 find_package(Libevent CONFIG)
 find_package(Libevent CONFIG)
 if(Libevent_FOUND)
 if(Libevent_FOUND)
     list(APPEND COMMON_LIBS libevent::core libevent::extra libevent::openssl)
     list(APPEND COMMON_LIBS libevent::core libevent::extra libevent::openssl)
+    if(NOT WIN32)
+        list(APPEND COMMON_LIBS libevent::pthreads)
+    endif()
 else()
 else()
     find_package(Libevent MODULE)
     find_package(Libevent MODULE)
     if(Libevent_FOUND)
     if(Libevent_FOUND)