From 885609909268ca5649e5399b61544fae2b8de603 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Fri, 25 Dec 2020 01:02:22 -0800 Subject: [PATCH] Build: Fix threads detection on libc with built-in support As noted in the FindThreads documentation[0], CMAKE_THREAD_LIBS_INIT may be empty if no special flags are needed to use thread support. Instead, use Threads_FOUND to determine if threads are supported. [0] https://cmake.org/cmake/help/latest/module/FindThreads.html --- CMakeModules/FindSDL2.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeModules/FindSDL2.cmake b/CMakeModules/FindSDL2.cmake index cb3084fc7..c619a389b 100644 --- a/CMakeModules/FindSDL2.cmake +++ b/CMakeModules/FindSDL2.cmake @@ -238,7 +238,7 @@ endif() # But for non-OSX systems, I will use the CMake Threads package. if(NOT APPLE) find_package(Threads QUIET) - if(NOT CMAKE_THREAD_LIBS_INIT AND NOT WIN32) + if(NOT Threads_FOUND AND NOT WIN32) set(SDL2_THREADS_NOT_FOUND "Could NOT find Threads (Threads is required by SDL2).") if(SDL2_FIND_REQUIRED) message(FATAL_ERROR ${SDL2_THREADS_NOT_FOUND})