From 67e771fe53f52cd7e92cab202e6044539e18dd1f Mon Sep 17 00:00:00 2001 From: Michael Meier Date: Tue, 11 Dec 2018 11:33:09 +0100 Subject: [PATCH] build: don't link against -lpthread on Android On Android, pthread is part of the C standard library. Hence, there is no need to specify -lpthread when building for Android. PR-URL: https://github.com/libuv/libuv/pull/2110 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f782e93b7..9f1c0587a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -210,7 +210,11 @@ if(WIN32) list(APPEND uv_test_sources src/win/snprintf.c test/runner-win.c) else() list(APPEND uv_defines _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE) - list(APPEND uv_libraries pthread) + if(NOT CMAKE_SYSTEM_NAME STREQUAL "Android") + # Android has pthread as part of its c library, not as a separate + # libpthread.so. + list(APPEND uv_libraries pthread) + endif() list(APPEND uv_sources src/unix/async.c src/unix/core.c