From: Samuel Just Date: Thu, 19 Dec 2019 00:05:14 +0000 (+0000) Subject: src/CMakeLists.txt: enable _GLIBCXX_ASSERTIONS in debug builds X-Git-Tag: v15.1.0~91^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=385215f2849f1fd6bc2e71f3574a8b6e7ef7458f;p=ceph.git src/CMakeLists.txt: enable _GLIBCXX_ASSERTIONS in debug builds We already enable this by default in our rpm builds. Adding it here as well increases the odds we'll catch things with make check and local testing. Signed-off-by: Samuel Just --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bb22331d38e1..a1a82845cb4b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -108,6 +108,11 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL GNU) endif() endif(CMAKE_CXX_COMPILER_ID STREQUAL GNU) +CHECK_C_COMPILER_FLAG("-D_GLIBCXX_ASSERTIONS" HAS_GLIBCXX_ASSERTIONS) +if(HAS_GLIBCXX_ASSERTIONS AND CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_ASSERTIONS") +endif() + include(SIMDExt) if(HAVE_INTEL) set(CMAKE_ASM_COMPILER ${PROJECT_SOURCE_DIR}/src/yasm-wrapper)