From 59512aea1f31c23c43ee639da7e591a058faa4f6 Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 7 May 2020 14:13:54 +0100 Subject: [PATCH] Windows: ensure RelWithDebInfo is fast Default CMake RelWithDebInfo pessimizes inlining --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba4f004f..f1dada75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -165,6 +165,11 @@ if (MSVC) else (EXISTS ${TEST_3RDPARTY_DIR}) set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted") endif (EXISTS ${TEST_3RDPARTY_DIR}) + + # override CMake default RelWithDebInfo flags. This is important to ensure + # good performance + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Zi /O2 /Ob2 /D NDEBUG") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "/Zi /O2 /Ob2 /D NDEBUG") else (MSVC) set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted") endif (MSVC)