diff --git a/CMake/FindPThreads.cmake b/CMake/FindPThreads.cmake index 01da7e0005..87d4c76457 100644 --- a/CMake/FindPThreads.cmake +++ b/CMake/FindPThreads.cmake @@ -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) diff --git a/CMakeLists.txt b/CMakeLists.txt index f49e6d6b11..44724c5dfc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()