From 7fa1340d416f597aca13064f767f233e284a1e27 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 9 May 2024 11:15:48 -0700 Subject: [PATCH] build: android bundles pthread into libc Add an additional flag to indicate that `-lc` is sufficient for pthread support and that `-lpthread` is not needed. This allows us to build with newer NDKs. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index eff610b89..b11d52266 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,6 +112,9 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_THREAD_PREFER_PTHREAD TRUE) set(THREADS_PREFER_PTHREAD_FLAG TRUE) +if(ANDROID) + set(CMAKE_HAVE_LIBC_PTHREAD YES) +endif() find_package(Threads REQUIRED) include(CheckCCompilerFlag)