From: Kefu Chai Date: Mon, 16 Aug 2021 17:07:45 +0000 (+0800) Subject: cmake: set CMAKE_BUILD_TYPE to Debug when .git exists X-Git-Tag: v17.1.0~1100^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=6e394b447b153042e5319561ba277a1e9adfc11a;p=ceph.git cmake: set CMAKE_BUILD_TYPE to Debug when .git exists if CMAKE_BUILD_TYPE is an empty string, we should also set it to Debug. Signed-off-by: Kefu Chai --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 59d0bce84ac29..bf18423a45b8c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -158,7 +158,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang) endif() endif(CMAKE_CXX_COMPILER_ID STREQUAL GNU) -if(NOT DEFINED CMAKE_BUILD_TYPE AND EXISTS "${CMAKE_SOURCE_DIR}/.git") +if(NOT CMAKE_BUILD_TYPE AND EXISTS "${CMAKE_SOURCE_DIR}/.git") set(default_build_type "Debug") set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Default BUILD_TYPE is Debug, other options are: RelWithDebInfo, Release, and MinSizeRel." FORCE)