From 372550d2d056708ffce9edca2b7c0390e26b1973 Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Mon, 1 Jan 2024 14:04:50 -0700 Subject: [PATCH] clang: Specify a default `CMAKE_BUILD_TYPE`. --- specs/clang/template/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/specs/clang/template/CMakeLists.txt b/specs/clang/template/CMakeLists.txt index 5c00635..e70db1c 100644 --- a/specs/clang/template/CMakeLists.txt +++ b/specs/clang/template/CMakeLists.txt @@ -1,6 +1,13 @@ cmake_minimum_required(VERSION 3.15) project("" VERSION 0.1.0) +# The default CMAKE_BUILD_TYPE is undefined, i.e. toolchain specific. Enforcing +# a default makes builds work more consistently. +if (NOT CMAKE_BUILD_TYPE) + message("CMAKE_BUILD_TYPE was not set. Defaulting to Debug") + set(CMAKE_BUILD_TYPE Debug) +endif() + # The primary executable. add_executable("" main.c)