提交 dc3dcd22 编写于 作者: G guokuankuan

Feature: Add a new build type for cmake: RelWithDebug

上级 09f949ca
......@@ -7,7 +7,7 @@ compile:
- echo $CI_COMMIT_SHA && git checkout $CI_COMMIT_SHA
- git submodule update --init --recursive
- mkdir build && cd build
- cmake ../ -DCMAKE_BUILD_TYPE=Debug -DWITH_TOOLS=ON -DWITH_TESTS=ON -DCMAKE_VERBOSE_MAKEFILE=ON
- cmake ../ -DCMAKE_BUILD_TYPE=RelWithDebug -DWITH_TOOLS=ON -DWITH_TESTS=ON -DCMAKE_VERBOSE_MAKEFILE=ON
- make -j $(nproc)
tags:
- terark
......
......@@ -8,12 +8,11 @@ if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif()
# Output full compile commands
# SET(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# SET(CMAKE_VERBOSE_MAKEFILE ON)
# Add a new build type `RelWithDebug`, flags: `-g2 -O2 -DDEBUG`
string(REGEX REPLACE "-DNDEBUG " "" CMAKE_CXX_FLAGS_RELWITHDEBUG "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDEBUG" )
string(REGEX REPLACE "-DNDEBUG " "" CMAKE_C_FLAGS_RELWITHDEBUG "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDEBUG" )
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules/")
SET(CMAKE_INSTALL_LIBDIR ${CMAKE_BINARY_DIR}/lib)
SET(CMAKE_INSTALL_BINDIR ${CMAKE_BINARY_DIR}/bin)
SET(CMAKE_INSTALL_INCLUDEDIR ${CMAKE_BINARY_DIR}/include)
......@@ -40,8 +39,8 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR CMAKE_BUILD_TYPE STREQUAL "Release"
set(WITH_ASAN OFF)
endif()
# RocksDB's UT has to be run under debug mode
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
# RocksDB's UT has to be run under Debug or RelWithDebug mode
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
SET(WITH_TESTS OFF CACHE BOOL OFF)
endif()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册