mirror of
https://github.com/cuberite/libevent.git
synced 2025-08-03 17:26:24 -04:00
cmake: avoid problems from use of CMAKE_USE_PTHREADS_INIT
In some CMake integrations, portions of the toolchain may end up defining CMAKE_USE_PTHREADS_INIT even when EVENT__DISABLE_THREAD_SUPPORT is set for libevent. Modify the build to not rely on this side effect of find_package(Threads, ...) [which could be done elsewhere] but instead to use EVENT__HAVE_PTHREADS which is defined only on the desired codepath. Without this change, affected builds fail as a result of event_pthreads source files being built but with build defines which cause the build to fail. Signed-off-by: Paul Osborne <paul.osborne@smartthings.com> (cherry picked from commit 26d5ff457c9e6cf9b84ec9d8fb83d87caf083d96)
This commit is contained in:
parent
fb5fa12ac0
commit
a62ec76561
@ -960,7 +960,7 @@ if (NOT EVENT__DISABLE_OPENSSL)
|
|||||||
SOURCES ${SRC_OPENSSL})
|
SOURCES ${SRC_OPENSSL})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_USE_PTHREADS_INIT)
|
if (EVENT__HAVE_PTHREADS)
|
||||||
set(SRC_PTHREADS evthread_pthread.c)
|
set(SRC_PTHREADS evthread_pthread.c)
|
||||||
add_event_library(event_pthreads
|
add_event_library(event_pthreads
|
||||||
INNER_LIBRARIES event_core
|
INNER_LIBRARIES event_core
|
||||||
@ -1130,7 +1130,7 @@ if (NOT EVENT__DISABLE_TESTS)
|
|||||||
if (NOT EVENT__DISABLE_THREAD_SUPPORT)
|
if (NOT EVENT__DISABLE_THREAD_SUPPORT)
|
||||||
list(APPEND SRC_REGRESS test/regress_thread.c)
|
list(APPEND SRC_REGRESS test/regress_thread.c)
|
||||||
endif()
|
endif()
|
||||||
elseif (CMAKE_USE_PTHREADS_INIT)
|
elseif (EVENT__HAVE_PTHREADS)
|
||||||
list(APPEND SRC_REGRESS test/regress_thread.c)
|
list(APPEND SRC_REGRESS test/regress_thread.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user