Skip to content

Commit

Permalink
cmake: Fix Android build.
Browse files Browse the repository at this point in the history
Android/Bionic C library needs no special flags to have threading support.
Found when trying to build with vcpkg.
  • Loading branch information
rpavlik authored and azat committed Oct 8, 2022
1 parent 285fc7c commit 8f47d8d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,11 @@ endif()
if (NOT EVENT__DISABLE_THREAD_SUPPORT)
if (WIN32)
list(APPEND SRC_CORE evthread_win32.c)
elseif(ANDROID)
# pthreads is built in to bionic
set(EVENT__HAVE_PTHREADS 1)
CHECK_TYPE_SIZE(pthread_t EVENT__SIZEOF_PTHREAD_T)
list(APPEND SYMBOLS_TO_CHECK pthread_mutexattr_setprotocol)
else()
find_package(Threads REQUIRED)
if (NOT CMAKE_USE_PTHREADS_INIT)
Expand Down

0 comments on commit 8f47d8d

Please sign in to comment.