Skip to content

Commit

Permalink
Fix finding winpthreads (flintlib#2171)
Browse files Browse the repository at this point in the history
  • Loading branch information
isuruf authored Jan 20, 2025
1 parent dd12a7f commit b34fe28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMake/FindPThreads.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if (PThreads_INCLUDE_DIRS AND PThreads_LIBRARIES)
endif (PThreads_INCLUDE_DIRS AND PThreads_LIBRARIES)

find_path(PThreads_INCLUDE_DIRS NAMES pthread.h )
find_library(PThreads_LIBRARIES NAMES pthreads libpthreads )
find_library(PThreads_LIBRARIES NAMES pthread pthreads libpthreads )

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PThreads DEFAULT_MSG PThreads_INCLUDE_DIRS PThreads_LIBRARIES)
Expand Down
9 changes: 1 addition & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,7 @@ if(MSVC)
set(PThreads_LIBRARIES PThreads4W::PThreads4W)
set(PThreads_INCLUDE_DIRS ${PThreads4W_INCLUDE_DIRS})
else()
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()
find_package(PThreads REQUIRED)
endif()
set(FLINT_USES_PTHREAD ON CACHE BOOL "Use POSIX Threads.")
else()
Expand Down

0 comments on commit b34fe28

Please sign in to comment.