From 5c561e3d777e2a170cdd92924e18f0f33edb4ff0 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Fri, 23 Dec 2016 16:58:05 +0100 Subject: [PATCH] fix(cmake): Use RelWithDebInfo as default build type --- cmake/build/core.cmake | 4 ++-- cmake/build/summary.cmake | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cmake/build/core.cmake b/cmake/build/core.cmake index 957f56ea..d16fe028 100644 --- a/cmake/build/core.cmake +++ b/cmake/build/core.cmake @@ -10,8 +10,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Set default build type if not specified if(NOT CMAKE_BUILD_TYPE) - message_colored(STATUS "No build type specified; using Release" 33) - set(CMAKE_BUILD_TYPE "Release") + message_colored(STATUS "No build type specified; using RelWithDebInfo" 33) + set(CMAKE_BUILD_TYPE "RelWithDebInfo") endif() # Compiler flags diff --git a/cmake/build/summary.cmake b/cmake/build/summary.cmake index af71bc52..d7bf7cc7 100644 --- a/cmake/build/summary.cmake +++ b/cmake/build/summary.cmake @@ -12,7 +12,11 @@ function(colored_option message_level text var color_on color_off) endfunction() message(STATUS "--------------------------") -message_colored(STATUS " Build type: ${CMAKE_BUILD_TYPE}" "32;1") +if(CMAKE_BUILD_TYPE) + message_colored(STATUS " Build type: ${CMAKE_BUILD_TYPE}" "32;1") +else() + message_colored(STATUS " Build type: NONE" "33;1") +endif() message(STATUS " Compiler C: ${CMAKE_C_COMPILER}") message(STATUS " Compiler C++: ${CMAKE_CXX_COMPILER}") message(STATUS " Compiler flags: ${CMAKE_CXX_FLAGS}") @@ -36,7 +40,9 @@ elseif(CMAKE_BUILD_TYPE_LOWER STREQUAL "relwithdebinfo") message(STATUS " relwithdebinfo: ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") endif() -message(STATUS " Linker flags: ${CMAKE_EXE_LINKER_FLAGS}") +if(CMAKE_EXE_LINKER_FLAGS) + message(STATUS " Linker flags: ${CMAKE_EXE_LINKER_FLAGS}") +endif() if(CXXLIB_CLANG) message(STATUS " C++ library: libc++")