Skip to content

Commit

Permalink
Reorder C11 and Win32 thread selection
Browse files Browse the repository at this point in the history
  • Loading branch information
derobins committed Nov 4, 2024
1 parent d38c2c7 commit 5718961
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand Down

0 comments on commit 5718961

Please sign in to comment.