From 9b7f8329355d5ebd20de3a6fcbca000bd4a4f2fd Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Fri, 20 Feb 2015 19:02:59 +0000 Subject: [PATCH] Setting up CMake to default to Debug when no build type is specified. Summary: Turns out if you don't set CMAKE_BUILD_TYPE the default is an empty string. This results in some of the behaviors of debug builds, but not all of them. For example ENABLE_ASSERTIONS is false. Reviewers: rnk Reviewed By: rnk Subscribers: chapuni, llvm-commits Differential Revision: http://reviews.llvm.org/D7360 llvm-svn: 230041 --- llvm/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 3da8ff0..27784c4 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -2,6 +2,11 @@ cmake_minimum_required(VERSION 2.8.8) +if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "No build type selected, default to Debug") + set(CMAKE_BUILD_TYPE "Debug") +endif() + # FIXME: It may be removed when we use 2.8.12. if(CMAKE_VERSION VERSION_LESS 2.8.12) # Invalidate a couple of keywords. -- 2.7.4