]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: Do a debug build by default 30799/head
authorBrad Hubbard <bhubbard@redhat.com>
Wed, 9 Oct 2019 01:52:33 +0000 (11:52 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Wed, 9 Oct 2019 03:55:26 +0000 (13:55 +1000)
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
src/CMakeLists.txt

index 60e261b10e609d3388986fc41cfe7bde0db4a70c..9a0036d1f72ee68deb82798bc61d13b528612c12 100644 (file)
@@ -74,7 +74,13 @@ endif(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
 set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}")
 
 if(NOT CMAKE_BUILD_TYPE)
-  set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Default BUILD_TYPE is RelWithDebInfo, other options are: Debug, Release, and MinSizeRel." FORCE)
+  if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
+    set(default_build_type "Debug")
+  else()
+    set(default_build_type "RelWithDebInfo")
+  endif()
+  set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
+      STRING "Default BUILD_TYPE is Debug, other options are: RelWithDebInfo, Release, and MinSizeRel." FORCE)
 endif()
 
 if(WITH_CEPH_DEBUG_MUTEX OR CMAKE_BUILD_TYPE STREQUAL Debug)