Skip to content

Commit b34fe28

Browse files
authored
Fix finding winpthreads (#2171)
1 parent dd12a7f commit b34fe28

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

CMake/FindPThreads.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if (PThreads_INCLUDE_DIRS AND PThreads_LIBRARIES)
99
endif (PThreads_INCLUDE_DIRS AND PThreads_LIBRARIES)
1010

1111
find_path(PThreads_INCLUDE_DIRS NAMES pthread.h )
12-
find_library(PThreads_LIBRARIES NAMES pthreads libpthreads )
12+
find_library(PThreads_LIBRARIES NAMES pthread pthreads libpthreads )
1313

1414
include(FindPackageHandleStandardArgs)
1515
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PThreads DEFAULT_MSG PThreads_INCLUDE_DIRS PThreads_LIBRARIES)

CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,7 @@ if(MSVC)
133133
set(PThreads_LIBRARIES PThreads4W::PThreads4W)
134134
set(PThreads_INCLUDE_DIRS ${PThreads4W_INCLUDE_DIRS})
135135
else()
136-
find_package(PThreads)
137-
if(NOT PThreads_FOUND)
138-
include(CheckIncludeFile)
139-
check_include_file(pthread.h HAVE_PTHREAD_H)
140-
if(NOT HAVE_PTHREAD_H)
141-
message(FATAL_ERROR "Could not find pthreads.")
142-
endif()
143-
endif()
136+
find_package(PThreads REQUIRED)
144137
endif()
145138
set(FLINT_USES_PTHREAD ON CACHE BOOL "Use POSIX Threads.")
146139
else()

0 commit comments

Comments
 (0)