[cmake] set default build type to Debug (#5709)

This commit is contained in:
Yakun Xu
2020-10-26 23:17:31 +08:00
committed by GitHub
parent 7b18147e03
commit de34f75b58
+5
View File
@@ -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)