diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2015-10-26 20:09:22 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2015-10-26 20:09:22 (GMT) |
commit | 00aaf8e6f45fed0e4a1dcce9de230826009e0b39 (patch) | |
tree | 59e3f8e838a01e335c8f6cd26b9f2728b2b08237 | |
parent | acbb71201b0adbb0961b0b5dcf8c5a830ac5cfa6 (diff) | |
download | hdf5-00aaf8e6f45fed0e4a1dcce9de230826009e0b39.zip hdf5-00aaf8e6f45fed0e4a1dcce9de230826009e0b39.tar.gz hdf5-00aaf8e6f45fed0e4a1dcce9de230826009e0b39.tar.bz2 |
[svn-r28228] Remove WIN32 only config of threadsafe
-rw-r--r-- | CMakeLists.txt | 93 | ||||
-rw-r--r-- | src/CMakeLists.txt | 1 |
2 files changed, 48 insertions, 46 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 33c8ddf..65124ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -535,53 +535,54 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Option to use threadsafe -# Note: Currently CMake only allows configuring of threadsafe on -# non-Cygwin WINDOWS. #----------------------------------------------------------------------------- -if (WIN32) - 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 (HDF5_ENABLE_PARALLEL) - if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** parallel and thread-safety options are not supported **** ") - else (NOT ALLOW_UNSUPPORTED) - message (STATUS " **** Allowing unsupported parallel and thread-safety options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_ENABLE_PARALLEL) - if (HDF5_BUILD_FORTRAN) - if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** Fortran and thread-safety options are not supported **** ") - else (NOT ALLOW_UNSUPPORTED) - message (STATUS " **** Allowing unsupported Fortran and thread-safety options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_BUILD_FORTRAN) - if (HDF5_BUILD_CPP_LIB) - if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** C++ and thread-safety options are not supported **** ") - else (NOT ALLOW_UNSUPPORTED) - message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_BUILD_CPP_LIB) - if (HDF5_BUILD_HL_LIB) - if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** HL and thread-safety options are not supported **** ") - else (NOT ALLOW_UNSUPPORTED) - message (STATUS " **** Allowing unsupported HL and thread-safety options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_BUILD_HL_LIB) - if (H5_HAVE_IOEO) - message (STATUS " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ") - set (H5_HAVE_WIN_THREADS 1) - else (H5_HAVE_IOEO) - if (NOT H5_HAVE_PTHREAD_H) - message (FATAL_ERROR " **** thread-safe option requires Win32 threads or Pthreads **** ") - endif (NOT H5_HAVE_PTHREAD_H) - endif (H5_HAVE_IOEO) - endif (HDF5_ENABLE_THREADSAFE) -endif (WIN32) +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 (HDF5_ENABLE_PARALLEL) + if (NOT ALLOW_UNSUPPORTED) + message (FATAL_ERROR " **** parallel and thread-safety options are not supported **** ") + else (NOT ALLOW_UNSUPPORTED) + message (STATUS " **** Allowing unsupported parallel and thread-safety options **** ") + endif (NOT ALLOW_UNSUPPORTED) + endif (HDF5_ENABLE_PARALLEL) + if (HDF5_BUILD_FORTRAN) + if (NOT ALLOW_UNSUPPORTED) + message (FATAL_ERROR " **** Fortran and thread-safety options are not supported **** ") + else (NOT ALLOW_UNSUPPORTED) + message (STATUS " **** Allowing unsupported Fortran and thread-safety options **** ") + endif (NOT ALLOW_UNSUPPORTED) + endif (HDF5_BUILD_FORTRAN) + if (HDF5_BUILD_CPP_LIB) + if (NOT ALLOW_UNSUPPORTED) + message (FATAL_ERROR " **** C++ and thread-safety options are not supported **** ") + else (NOT ALLOW_UNSUPPORTED) + message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ") + endif (NOT ALLOW_UNSUPPORTED) + endif (HDF5_BUILD_CPP_LIB) + if (HDF5_BUILD_HL_LIB) + if (NOT ALLOW_UNSUPPORTED) + message (FATAL_ERROR " **** HL and thread-safety options are not supported **** ") + else (NOT ALLOW_UNSUPPORTED) + message (STATUS " **** Allowing unsupported HL and thread-safety options **** ") + endif (NOT ALLOW_UNSUPPORTED) + endif (HDF5_BUILD_HL_LIB) + if (H5_HAVE_IOEO) + message (STATUS " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ") + set (H5_HAVE_WIN_THREADS 1) + else (H5_HAVE_IOEO) + if (NOT H5_HAVE_PTHREAD_H) + message (FATAL_ERROR " **** thread-safe option requires Win32 threads or Pthreads **** ") + endif (NOT H5_HAVE_PTHREAD_H) + endif (H5_HAVE_IOEO) + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads) + if (NOT Threads_FOUND) + message (STATUS " **** thread-safe package not found - threads still might work **** ") + endif (NOT Threads_FOUND) +endif (HDF5_ENABLE_THREADSAFE) # ----------------------------------------------------------------------- # wrapper script variables diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cf218d7..b7656a1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -887,6 +887,7 @@ if (BUILD_SHARED_LIBS) APPEND PROPERTY COMPILE_DEFINITIONS "H5_HAVE_THREADSAFE" ) + target_link_libraries (${HDF5_LIBSH_TARGET} Threads::Threads) endif (HDF5_ENABLE_THREADSAFE) if (HDF5_ENABLE_DEBUG_APIS) |