SDL: Don't include pthreads code when threads are disabled

From bbac1e9add121c76fce91c8c146afd7116a62acf Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 14 Nov 2021 20:34:41 -0800
Subject: [PATCH] Don't include pthreads code when threads are disabled

Fixes https://github.com/libsdl-org/SDL/issues/4950
---
 cmake/sdlchecks.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index dbf4490da3..6ba476fd1f 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -859,7 +859,7 @@ endmacro()
 # PTHREAD_CFLAGS
 # PTHREAD_LIBS
 macro(CheckPTHREAD)
-  if(SDL_PTHREADS)
+  if(SDL_THREADS AND SDL_PTHREADS)
     if(ANDROID)
       # the android libc provides built-in support for pthreads, so no
       # additional linking or compile flags are necessary