mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
[svn-r28228] Remove WIN32 only config of threadsafe
This commit is contained in:
parent
acbb71201b
commit
00aaf8e6f4
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user