From de34f75b5872df0ce474029eedb8e5fb5f0f20b2 Mon Sep 17 00:00:00 2001 From: Yakun Xu Date: Mon, 26 Oct 2020 23:17:31 +0800 Subject: [PATCH] [cmake] set default build type to Debug (#5709) --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2a1efe1d..b13e96a49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,11 @@ include("${PROJECT_SOURCE_DIR}/etc/cmake/checks.cmake") include("${PROJECT_SOURCE_DIR}/etc/cmake/options.cmake") include("${PROJECT_SOURCE_DIR}/etc/cmake/functions.cmake") +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "default build type: Debug" FORCE) +endif() +message(STATUS "CMake build type: ${CMAKE_BUILD_TYPE}") + if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang") option(OT_COMPILE_WARNING_AS_ERROR "whether to include -Werror -pedantic-errors with gcc-compatible compilers") if (OT_COMPILE_WARNING_AS_ERROR)