define NDEBUG in CMake non-debug builds

Summary:
This brings CMake builds further in line with builds that go through
the normal Makefile.
Closes https://github.com/facebook/rocksdb/pull/2300

Differential Revision: D5064631

Pulled By: yiwu-arbug

fbshipit-source-id: 7b2b2d5299f575f87badcf590cc95e040f14d52d
This commit is contained in:
Nikhil Benesch 2017-05-16 10:31:24 -07:00 committed by Facebook Github Bot
parent 1ca723dbd1
commit a48a62d5ba
1 changed files with 1 additions and 0 deletions

View File

@ -174,6 +174,7 @@ else()
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DNDEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -fno-omit-frame-pointer")
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-momit-leaf-frame-pointer" HAVE_OMIT_LEAF_FRAME_POINTER)