diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2019-08-28 18:51:25 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2019-08-28 18:51:25 (GMT) |
commit | b5c2b64307dc01128d2a90771cf51076bc1252db (patch) | |
tree | 01b6f0f3673f23c5a97b82a5c457bc5220632528 /CMakeLists.txt | |
parent | 623e0041a493e2c9937d09de6a0682472fe88d05 (diff) | |
download | hdf5-b5c2b64307dc01128d2a90771cf51076bc1252db.zip hdf5-b5c2b64307dc01128d2a90771cf51076bc1252db.tar.gz hdf5-b5c2b64307dc01128d2a90771cf51076bc1252db.tar.bz2 |
Correct threadsafe enable code
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a611b71..f6d55b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -684,8 +684,10 @@ endif () option (HDF5_ENABLE_THREADSAFE "Enable thread-safety" OFF) if (HDF5_ENABLE_THREADSAFE) # check for unsupported options - message (STATUS " **** thread-safety option not supported with static library **** ") - message (STATUS " **** thread-safety option will not be used building static library **** ") + if (WIN32 OR MINGW) + message (STATUS " **** thread-safety option not supported with static library **** ") + message (STATUS " **** thread-safety option will not be used building static library **** ") + endif () if (HDF5_ENABLE_PARALLEL) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** parallel and thread-safety options are not supported **** ") @@ -723,9 +725,9 @@ if (HDF5_ENABLE_THREADSAFE) endif () endif () set(THREADS_PREFER_PTHREAD_FLAG ON) - find_package(Threads) - if (NOT Threads_FOUND) - message (STATUS " **** thread-safe package not found - threads still might work **** ") + find_package(Threads REQUIRED) + if (Threads_FOUND) + set (H5_HAVE_THREADSAFE 1) endif () endif () |