From 1b8117be21e6c86511fea1fc553cbda1e20c07cb Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 9 Aug 2017 19:50:18 -0400 Subject: [PATCH] cmake: Don't link directly against a libpthread on Android (thanks, Anthony!). Android has pthreads, but it's just part of their C runtime instead of a separate library like the usual Linux platforms. Fixes Bugzilla #3675. --- cmake/sdlchecks.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake index 15834f5f8..4ce64c2f7 100644 --- a/cmake/sdlchecks.cmake +++ b/cmake/sdlchecks.cmake @@ -856,7 +856,10 @@ endmacro() # PTHREAD_LIBS macro(CheckPTHREAD) if(PTHREADS) - if(LINUX) + if(ANDROID) + # the android libc provides built-in support for pthreads, so no + # additional linking or compile flags are necessary + elseif(LINUX) set(PTHREAD_CFLAGS "-D_REENTRANT") set(PTHREAD_LDFLAGS "-pthread") elseif(ANDROID)