From fe56b8272b119a9937a5cc7fbafd8a9bd2fbe427 Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 7 May 2020 14:13:10 +0100 Subject: [PATCH] Windows: ensure RelWithDebInfo is fast Default CMake RelWithDebInfo pessimizes inlining --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c49a1edd8..ce3b7bddf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -492,6 +492,10 @@ endif() if(WIN32) if(MSVC) + # override CMake default RelWithDebInfo flags. This is important to ensure + # good performance + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob2 /D NDEBUG") + set(MSVC_FLAGS "-DNOMINMAX -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS /MP /O2") if(ENABLE_SIMD) if (X86)