From c1d27fa453977c1e69d43e24f57ba69ce69b07a0 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Thu, 19 Mar 2026 12:39:14 -0700 Subject: [PATCH] Cmake: Default to release builds with a message People keep forgetting to set this and have a worse experience. Default to a Release build, which ensures optimizations are enabled and assertions are disabled. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a130df38..0252f79ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -172,6 +172,13 @@ set(TUNE_ARCH "generic" CACHE STRING "Override the Arch the build is tuned for") set(OVERRIDE_VERSION "detect" CACHE STRING "Override the FEX version") set(OVERRIDE_HASH "detect" CACHE STRING "Override the FEX git hash") +get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if (NOT IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release + CACHE STRING "Choose the type of build." FORCE) + message(STATUS "No build type set, defaulting to a Release build") +endif() + string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE) if (CMAKE_BUILD_TYPE MATCHES "DEBUG") set(ENABLE_ASSERTIONS TRUE)