CMake: Fix finding threads on Android

See #24298
This commit is contained in:
Maarten Bent 2024-02-25 14:58:54 +01:00
parent d8d393e4b8
commit 04cbeb0f8a
No known key found for this signature in database
GPG key ID: 58AAEE3F4A4FD070

View file

@ -330,7 +330,14 @@ if(wxUSE_INTL AND NOT wxUSE_FILE)
endif()
if(wxUSE_THREADS)
find_package(Threads REQUIRED)
if(ANDROID)
# Android has pthreads but FindThreads fails due to missing pthread_cancel
set(CMAKE_USE_PTHREADS_INIT 1)
set(CMAKE_THREAD_LIBS_INIT "")
set(Threads_FOUND TRUE)
else()
find_package(Threads REQUIRED)
endif()
endif()
if(wxUSE_LIBLZMA)