From ba95764f1c94811895205f171b4ab1031b84b974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Wed, 9 Aug 2023 21:43:34 +0200 Subject: [PATCH] Fix 57717a2: VS2022 optimisation bug is fixed with MSVC 19.37 (#11172) --- cmake/CompileFlags.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/CompileFlags.cmake b/cmake/CompileFlags.cmake index 6a942b2160..a499714481 100644 --- a/cmake/CompileFlags.cmake +++ b/cmake/CompileFlags.cmake @@ -56,8 +56,8 @@ macro(compile_flags) if(MSVC) add_compile_options(/W3) - if(MSVC_VERSION GREATER 1929 AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - # Starting with version 19.30, there is an optimisation bug, see #9966 for details + if(MSVC_VERSION GREATER 1929 AND MSVC_VERSION LESS 1937 AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # Starting with version 19.30 (fixed in version 19.37), there is an optimisation bug, see #9966 for details # This flag disables the broken optimisation to work around the bug add_compile_options(/d2ssa-rse-) endif()