From 6e394b447b153042e5319561ba277a1e9adfc11a Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 17 Aug 2021 01:07:45 +0800 Subject: [PATCH] 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 --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.39.5