From 2a6155f1107a5f1dec3c41b2d843e521756b5bb0 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 23 Jun 2022 11:19:06 +0200 Subject: cmake bullshit build type was not honored before because we always set it to Debug. Now it is, although if you don't pass it and it defaults to Debug, the setting will still be empty in ccmake. Also, in ccmake, the CXX_FLAGS_* will show their default values, even though the values we set in CMakeLists.txt get used. Go figure. --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 90caaa3..7e1f2af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,9 +3,14 @@ cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) # cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug .. # project name -project(speedcheck) +project(speedcheck LANGUAGES CXX) + +# set compilation in debug mode as default configuration +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Debug) + message(STATUS "Build type is not set. Defaulting to ${CMAKE_BUILD_TYPE} build!") +endif(NOT CMAKE_BUILD_TYPE) -set(CMAKE_BUILD_TYPE Debug) set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wall -Wextra -pedantic -Werror -Wno-multichar") set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wno-multichar") -- cgit v1.2.3-55-g7522