From 643ac7a069265b26b0ba6ab0c11caa8b8d3a9977 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 9 Aug 2022 10:47:44 +0200 Subject: [PATCH] cmake: attempt to fix gh-actions not declaring HAVE_PTHREAD_H --- CMake/CheckThreads.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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() -- 2.30.2