mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
parent
35375101e7
commit
4d85d28acd
@ -556,6 +556,7 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(PTHREADS_AVAILABLE OFF)
|
||||
if (NOT EVENT__DISABLE_THREAD_SUPPORT)
|
||||
if (WIN32)
|
||||
list(APPEND SRC_CORE evthread_win32.c)
|
||||
@ -564,12 +565,14 @@ if (NOT EVENT__DISABLE_THREAD_SUPPORT)
|
||||
set(EVENT__HAVE_PTHREADS 1)
|
||||
CHECK_TYPE_SIZE(pthread_t EVENT__SIZEOF_PTHREAD_T)
|
||||
list(APPEND SYMBOLS_TO_CHECK pthread_mutexattr_setprotocol)
|
||||
set(PTHREADS_AVAILABLE ON)
|
||||
else()
|
||||
find_package(Threads REQUIRED)
|
||||
if (NOT CMAKE_USE_PTHREADS_INIT)
|
||||
message(FATAL_ERROR
|
||||
"Failed to find Pthreads, set EVENT__DISABLE_THREAD_SUPPORT to disable")
|
||||
endif()
|
||||
set(PTHREADS_AVAILABLE ON)
|
||||
|
||||
set(EVENT__HAVE_PTHREADS 1)
|
||||
list(APPEND LIB_APPS ${CMAKE_THREAD_LIBS_INIT})
|
||||
@ -1294,7 +1297,7 @@ if (NOT EVENT__DISABLE_TESTS)
|
||||
if (NOT EVENT__DISABLE_MBEDTLS)
|
||||
target_link_libraries(regress event_mbedtls)
|
||||
endif()
|
||||
if (CMAKE_USE_PTHREADS_INIT)
|
||||
if (PTHREADS_AVAILABLE)
|
||||
target_link_libraries(regress event_pthreads)
|
||||
endif()
|
||||
else()
|
||||
|
Loading…
x
Reference in New Issue
Block a user