summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d27962d..4e42153 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -758,6 +758,18 @@ if (HDF5_ENABLE_SUBFILING_VFD)
if (NOT HDF5_ENABLE_PARALLEL)
message (FATAL_ERROR "Subfiling VFD requires a parallel HDF5 build")
endif()
+
+ if (NOT DEFINED Threads_FOUND)
+ set (THREADS_PREFER_PTHREAD_FLAG ON)
+ find_package (Threads REQUIRED)
+ endif ()
+
+ # For now, make sure we're using pthreads. Once Subfiling can be
+ # supported on Windows, we should allow Win32 threads as well
+ if (NOT ${Threads_FOUND} OR NOT ${CMAKE_USE_PTHREADS_INIT})
+ message (FATAL_ERROR "Subfiling requires pthreads for system thread library")
+ endif ()
+
CHECK_INCLUDE_FILE("stdatomic.h" HAVE_STDATOMIC_H)
if (NOT HAVE_STDATOMIC_H)
message (FATAL_ERROR "Subfiling VFD requires atomic operations support. C11 stdatomic.h NOT available.")