Skip to content

Commit

Permalink
Merge pull request flintlib#2153 from albinahlback/tobias_patch
Browse files Browse the repository at this point in the history
Check for pthread.h in CMake if no package could be found
  • Loading branch information
albinahlback authored Jan 13, 2025
2 parents 54bfda0 + 6945188 commit cd78d65
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,14 @@ if(MSVC)
set(PThreads_LIBRARIES PThreads4W::PThreads4W)
set(PThreads_INCLUDE_DIRS ${PThreads4W_INCLUDE_DIRS})
else()
find_package(PThreads REQUIRED)
find_package(PThreads)
if(NOT PThreads_FOUND)
include(CheckIncludeFile)
check_include_file(pthread.h HAVE_PTHREAD_H)
if(NOT HAVE_PTHREAD_H)
message(FATAL_ERROR "Could not find pthreads.")
endif()
endif()
endif()
set(FLINT_USES_PTHREAD ON CACHE BOOL "Use POSIX Threads.")
else()
Expand Down

0 comments on commit cd78d65

Please sign in to comment.