diff --git a/cmake/re-config.cmake b/cmake/re-config.cmake index 04023d923..6dc0ad8b6 100644 --- a/cmake/re-config.cmake +++ b/cmake/re-config.cmake @@ -67,7 +67,11 @@ else() set(Backtrace_LIBRARIES) endif() -check_function_exists(thrd_create HAVE_THREADS) +check_function_exists(thrd_create HAVE_THREADS_FUN) +check_include_file(threads.h HAVE_THREADS_H) +if(HAVE_THREADS_FUN AND HAVE_THREADS_H) + set(HAVE_THREADS CACHE BOOL true) +endif() if(HAVE_THREADS) list(APPEND RE_DEFINITIONS HAVE_THREADS) endif()