From 9a580deeef28004f41defcdbd282fad647fdd5a9 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Thu, 16 Nov 2023 09:08:47 +0100 Subject: [PATCH 1/4] cmake/config: set HAVE_THREADS only if threads.h --- cmake/re-config.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/re-config.cmake b/cmake/re-config.cmake index 04023d923..ec235677a 100644 --- a/cmake/re-config.cmake +++ b/cmake/re-config.cmake @@ -67,8 +67,9 @@ else() set(Backtrace_LIBRARIES) endif() -check_function_exists(thrd_create HAVE_THREADS) -if(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) list(APPEND RE_DEFINITIONS HAVE_THREADS) endif() From 2d3b3eedec8e98bc4908f02c72cc0c82226988b2 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Thu, 16 Nov 2023 09:27:33 +0100 Subject: [PATCH 2/4] fix HAVE_THREADS cmake var --- cmake/re-config.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/re-config.cmake b/cmake/re-config.cmake index ec235677a..ba50406ff 100644 --- a/cmake/re-config.cmake +++ b/cmake/re-config.cmake @@ -70,6 +70,7 @@ endif() 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 true) list(APPEND RE_DEFINITIONS HAVE_THREADS) endif() From e07088ff4617d728e3a0cf98c7d31a54e7887843 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Thu, 16 Nov 2023 09:37:48 +0100 Subject: [PATCH 3/4] fix HAVE_THREADS cache entry --- cmake/re-config.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/re-config.cmake b/cmake/re-config.cmake index ba50406ff..a6c8af195 100644 --- a/cmake/re-config.cmake +++ b/cmake/re-config.cmake @@ -70,7 +70,9 @@ endif() 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 true) + set(HAVE_THREADS CACHE BOOL true) +endif() +if(HAVE_THREADS) list(APPEND RE_DEFINITIONS HAVE_THREADS) endif() From 989f2d5c17a8fd597abb48474c791ccc1e335147 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Thu, 16 Nov 2023 09:39:35 +0100 Subject: [PATCH 4/4] fix indentation --- cmake/re-config.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/re-config.cmake b/cmake/re-config.cmake index a6c8af195..6dc0ad8b6 100644 --- a/cmake/re-config.cmake +++ b/cmake/re-config.cmake @@ -70,7 +70,7 @@ endif() 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) + set(HAVE_THREADS CACHE BOOL true) endif() if(HAVE_THREADS) list(APPEND RE_DEFINITIONS HAVE_THREADS)