From 571896169cb3ad2bb80510c2eef3cca4f7d1c2d2 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 3 Nov 2024 22:20:15 -0800 Subject: [PATCH] Reorder C11 and Win32 thread selection --- CMakeLists.txt | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5574059c7..ad1ce65d05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -800,16 +800,13 @@ if (Threads_FOUND) set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) # Determine which threading package to use - # Comment out check for C11 threads for now, since it conflicts with the - # current --std=c99 compile flags at configuration time. When we switch to - # --std=c11, this can be uncommented. CHECK_INCLUDE_FILE("threads.h" HAVE_THREADS_H) - if (WIN32) - # When Win32 is available, we use those threads - set (H5_HAVE_WIN_THREADS 1) - elseif (HAVE_THREADS_H) - # When C11 threads are available, those are the top choice + if (HAVE_THREADS_H) + # Prefer C11 threads set (H5_HAVE_C11_THREADS 1) + elseif (WIN32) + # On Windows, if we didn't find C11 threads, use Win32 threads instead + set (H5_HAVE_WIN_THREADS 1) elseif (CMAKE_USE_PTHREADS_INIT) set (H5_HAVE_PTHREAD_H 1) else ()