From 10078841fb5319ad7d870fe949172e3053b4e5f1 Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Tue, 27 Jun 2017 12:58:29 -0500 Subject: [PATCH] Remove NDEBUG definition from RelWithDebInfo to enable asserts. --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e261443b0..8b8b43c86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -195,10 +195,12 @@ IF(UNIX) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -march=i686") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -march=i686") ENDIF() + STRING(REPLACE "-DNDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") ELSEIF(MSVC) # for msvc, tell it to always use 8-byte pointers to member functions to avoid confusion SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /vmg /vmm /MP") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od") + STRING(REPLACE "/DNDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") ENDIF() # use shared libraries for protobuf