From: Michael Wallner Date: Tue, 9 Aug 2022 08:47:44 +0000 (+0200) Subject: cmake: attempt to fix gh-actions not declaring HAVE_PTHREAD_H X-Git-Tag: 1.1.2~3^2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=refs%2Fpull%2F126%2Fhead;p=awesomized%2Flibmemcached cmake: attempt to fix gh-actions not declaring HAVE_PTHREAD_H --- diff --git a/CMake/CheckThreads.cmake b/CMake/CheckThreads.cmake index ab746248..e4f53c2b 100644 --- a/CMake/CheckThreads.cmake +++ b/CMake/CheckThreads.cmake @@ -1,5 +1,9 @@ -configure_define(HAVE_PTHREAD_H) set(THREADS_PREFER_PTHREAD_FLAG ON) set(CMAKE_THREAD_PREFER_PTHREAD ON) find_package(Threads) -set(HAVE_PTHREAD_H ${CMAKE_HAVE_PTHREAD_H} CACHE INTERNAL "FindThreads found pthread.h") +if(CMAKE_HAVE_PTHREAD_H) + configure_define(HAVE_PTHREAD_H) + set(HAVE_PTHREAD_H ${CMAKE_HAVE_PTHREAD_H} CACHE INTERNAL "FindThreads found pthread.h") +elseif(CMAKE_USE_PTHREADS_INIT) + check_cxx_include(pthread.h) +endif()