]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: set CMAKE_BUILD_TYPE to Debug when .git exists 42800/head
authorKefu Chai <kchai@redhat.com>
Mon, 16 Aug 2021 17:07:45 +0000 (01:07 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 17 Aug 2021 00:47:33 +0000 (08:47 +0800)
if CMAKE_BUILD_TYPE is an empty string, we should also set it to Debug.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/CMakeLists.txt

index 59d0bce84ac29646cde7f202a35f67cddb0a476e..bf18423a45b8c7cec170560285b6b2eb71e35049 100644 (file)
@@ -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)