Skip to content

Commit

Permalink
cmake: Don't link directly against a libpthread on Android (thanks, A…
Browse files Browse the repository at this point in the history
…nthony!).

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.
  • Loading branch information
icculus committed Aug 9, 2017
1 parent 2b5a5c5 commit 1b8117b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmake/sdlchecks.cmake
Expand Up @@ -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)
Expand Down

0 comments on commit 1b8117b

Please sign in to comment.