From 1f4b8d74d54266b024fdc43d27cbc394aa73be60 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 16 Jun 2024 19:32:07 +0200 Subject: [PATCH] MSVC: Fix crash with std::mutex See https://stackoverflow.com/questions/78598141/first-stdmutexlock-crashes-in-application-built-with-latest-visual-studio --- cMake/FreeCAD_Helpers/SetGlobalCompilerAndLinkerSettings.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cMake/FreeCAD_Helpers/SetGlobalCompilerAndLinkerSettings.cmake b/cMake/FreeCAD_Helpers/SetGlobalCompilerAndLinkerSettings.cmake index dc97e691f0..13eb953dd1 100644 --- a/cMake/FreeCAD_Helpers/SetGlobalCompilerAndLinkerSettings.cmake +++ b/cMake/FreeCAD_Helpers/SetGlobalCompilerAndLinkerSettings.cmake @@ -21,6 +21,7 @@ macro(SetGlobalCompilerAndLinkerSettings) if(MSVC) # set default compiler settings + add_definitions(-D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zm150 /bigobj") set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFC_DEBUG /Zm150 /bigobj") # set default libs