From 3404f8a63bd790c53c147af9e071ea3827401625 Mon Sep 17 00:00:00 2001 From: Chris Johnsen Date: Wed, 5 Aug 2026 03:34:06 -0500 Subject: [PATCH] CMake: update empty CMAKE_BUILD_TYPE value to Release The `set(... CACHE ...)` call without `FORCE` does not update the cached value for variables that *already* have cached values. The `project()` command establishes an initial, *cached* value for CMAKE_BUILD_TYPE (if one was not supplied on the command line). Since this non-`FORCE` `set` is run after `project` it effectively never updates the cached value. Add `FORCE` to ensure the cached value is updated. This matches the associated handling of CMAKE_CONFIGURATION_TYPES, and will still work if this combined check/update block is moved above the `project` call (as it was in some earlier commits). --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1495bea2b1..5159973255 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,7 @@ else(CMAKE_CONFIGURATION_TYPES) set(DFHACK_TYPE_HELP "Choose the type of build, options are: Release and RelWithDebInfo") # Prevent cmake C module attempts to overwrite our help string if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release" CACHE STRING "${DFHACK_TYPE_HELP}") + set(CMAKE_BUILD_TYPE "Release" CACHE STRING "${DFHACK_TYPE_HELP}" FORCE) else(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "${DFHACK_TYPE_HELP}") endif(NOT CMAKE_BUILD_TYPE)