Skip to content

Commit e645ebf

Browse files
Fix: Add _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR to prevent crashes (#1814)
* Fix: Add _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR for compatibility with older MSVC runtimes. * Document the issue reference as suggested by Gemini Code assist. --------- Co-authored-by: a-maurice <amaurice@google.com>
1 parent e5c95d8 commit e645ebf

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ if (MSVC)
199199
$<$<CONFIG:Release>:/MD>
200200
)
201201
endif()
202+
# Disable constexpr mutex constructor to fix crashes on older vcruntimes.
203+
# See: https://github.com/microsoft/STL/issues/4730
204+
add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
202205
endif()
203206

204207
# Set variables that are used by download_external_sources.

0 commit comments

Comments
 (0)