Skip to content

Commit

Permalink
Build: Fix threads detection on libc with built-in support
Browse files Browse the repository at this point in the history
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
  • Loading branch information
michaelforney authored and stenzek committed Dec 25, 2020
1 parent 7a40a84 commit 8856099
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeModules/FindSDL2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit 8856099

Please sign in to comment.