diff --git a/CMakeLists.txt b/CMakeLists.txt index 52e20ee2bdb..28234cd996b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,10 @@ # ####################### +# Adjust default RelWithDebInfo flags to be in line with "Release with Debug". +# The default RelWithDebInfo uses -O2, but Release uses -O3. This difference can be astonishing to users +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG") + if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) message(FATAL_ERROR "In source builds are disabled. Use a preset, -B or run from a different directory") endif()