Skip to content

Commit

Permalink
Disable static + thread-safe on Windows w/ CMake (HDFGroup#3622)
Browse files Browse the repository at this point in the history
The thread-safety feature on Windows requires a hook in DllMain() and
thus is only available when HDF5 is built as a shared library.

This was previously a warning, but has now been elevated to a fatal
error that cannot be overridden with ALLOW_UNSUPPORTED.

Fixes GitHub HDFGroup#3613
  • Loading branch information
derobins committed Oct 3, 2023
1 parent 42549af commit fe0bd36
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,9 @@ option (HDF5_ENABLE_THREADSAFE "Enable thread-safety" OFF)
if (HDF5_ENABLE_THREADSAFE)
# check for unsupported options
if (WIN32)
message (VERBOSE " **** thread-safety option not supported with static library **** ")
message (VERBOSE " **** thread-safety option will not be used building static library **** ")
if (BUILD_STATIC_LIBS)
message (FATAL_ERROR " **** thread-safety option not supported with static library **** ")
endif ()
endif ()
if (HDF5_BUILD_FORTRAN)
if (NOT ALLOW_UNSUPPORTED)
Expand Down
14 changes: 10 additions & 4 deletions release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@ New Features

Configuration:
-------------
-
- Thread-safety + static library disabled on Windows w/ CMake

The thread-safety feature requires hooks in DllMain(), which is only
present in the shared library.

We previously just warned about this, but now any CMake configuration
that tries to build thread-safety and the static library will fail.
This cannot be overridden with ALLOW_UNSUPPORTED.

Fixes GitHub issue #3613


Library:
Expand All @@ -62,9 +71,6 @@ New Features

Fortran Library:
----------------
-


- Removed "-commons" linking option on Darwin, as COMMON and EQUIVALENCE
are no longer used in the Fortran source.

Expand Down

0 comments on commit fe0bd36

Please sign in to comment.