From 57e29c5c43d0bfb86f674bacd63d2c55fffb9ea7 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Wed, 12 Nov 2025 22:49:07 -0500 Subject: [PATCH 1/2] build(debug): add CMake option for debug cheats in release builds --- Core/GameEngine/Include/Common/GameCommon.h | 2 -- cmake/config-debug.cmake | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/GameEngine/Include/Common/GameCommon.h b/Core/GameEngine/Include/Common/GameCommon.h index 1e7c224fd5a..62c6c3429f0 100644 --- a/Core/GameEngine/Include/Common/GameCommon.h +++ b/Core/GameEngine/Include/Common/GameCommon.h @@ -47,8 +47,6 @@ #pragma once -#define DONT_ALLOW_DEBUG_CHEATS_IN_RELEASE ///< Take of the DONT to get cheats back in to release - //#define _CAMPEA_DEMO // ---------------------------------------------------------------------------------------------- diff --git a/cmake/config-debug.cmake b/cmake/config-debug.cmake index e9bb8f3ece9..019d66b86de 100644 --- a/cmake/config-debug.cmake +++ b/cmake/config-debug.cmake @@ -10,6 +10,9 @@ set_property(CACHE RTS_DEBUG_STACKTRACE PROPERTY STRINGS DEFAULT ON OFF) set(RTS_DEBUG_PROFILE "DEFAULT" CACHE STRING "Enables debug profiling. When DEFAULT, this option is enabled with DEBUG or INTERNAL") set_property(CACHE RTS_DEBUG_PROFILE PROPERTY STRINGS DEFAULT ON OFF) +set(RTS_DEBUG_CHEATS "DEFAULT" CACHE STRING "Enables debug cheats in release builds. When DEFAULT, this option is enabled with DEBUG or INTERNAL") +set_property(CACHE RTS_DEBUG_CHEATS PROPERTY STRINGS DEFAULT ON OFF) + option(RTS_DEBUG_INCLUDE_DEBUG_LOG_IN_CRC_LOG "Includes normal debug log in crc log" OFF) option(RTS_DEBUG_MULTI_INSTANCE "Enables multi client instance support" OFF) @@ -34,6 +37,7 @@ define_debug_option(RTS_DEBUG_LOGGING DEBUG_LOGGING DISABLE_DEBUG_LOGGING define_debug_option(RTS_DEBUG_CRASHING DEBUG_CRASHING DISABLE_DEBUG_CRASHING DebugCrashing "Build with Debug Crashing") define_debug_option(RTS_DEBUG_STACKTRACE DEBUG_STACKTRACE DISABLE_DEBUG_STACKTRACE DebugStacktrace "Build with Debug Stacktracing") define_debug_option(RTS_DEBUG_PROFILE DEBUG_PROFILE DISABLE_DEBUG_PROFILE DebugProfile "Build with Debug Profiling") +define_debug_option(RTS_DEBUG_CHEATS _ALLOW_DEBUG_CHEATS_IN_RELEASE DISABLE_DEBUG_CHEATS_IN_RELEASE DebugCheats "Build with Debug Cheats") add_feature_info(DebugIncludeDebugLogInCrcLog RTS_DEBUG_INCLUDE_DEBUG_LOG_IN_CRC_LOG "Build with Debug Logging in CRC log") add_feature_info(DebugMultiInstance RTS_DEBUG_MULTI_INSTANCE "Build with Multi Client Instance support") From 458b33f090efb53893890ba4d92a8cfcbf4e140c Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Fri, 30 Jan 2026 01:16:35 -0600 Subject: [PATCH 2/2] build(debug): simplify RTS_DEBUG_CHEATS to ON/OFF option --- cmake/config-debug.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/config-debug.cmake b/cmake/config-debug.cmake index 019d66b86de..13eececeeb8 100644 --- a/cmake/config-debug.cmake +++ b/cmake/config-debug.cmake @@ -10,9 +10,7 @@ set_property(CACHE RTS_DEBUG_STACKTRACE PROPERTY STRINGS DEFAULT ON OFF) set(RTS_DEBUG_PROFILE "DEFAULT" CACHE STRING "Enables debug profiling. When DEFAULT, this option is enabled with DEBUG or INTERNAL") set_property(CACHE RTS_DEBUG_PROFILE PROPERTY STRINGS DEFAULT ON OFF) -set(RTS_DEBUG_CHEATS "DEFAULT" CACHE STRING "Enables debug cheats in release builds. When DEFAULT, this option is enabled with DEBUG or INTERNAL") -set_property(CACHE RTS_DEBUG_CHEATS PROPERTY STRINGS DEFAULT ON OFF) - +option(RTS_DEBUG_CHEATS "Enables debug cheats in release builds" OFF) option(RTS_DEBUG_INCLUDE_DEBUG_LOG_IN_CRC_LOG "Includes normal debug log in crc log" OFF) option(RTS_DEBUG_MULTI_INSTANCE "Enables multi client instance support" OFF) @@ -37,12 +35,16 @@ define_debug_option(RTS_DEBUG_LOGGING DEBUG_LOGGING DISABLE_DEBUG_LOGGING define_debug_option(RTS_DEBUG_CRASHING DEBUG_CRASHING DISABLE_DEBUG_CRASHING DebugCrashing "Build with Debug Crashing") define_debug_option(RTS_DEBUG_STACKTRACE DEBUG_STACKTRACE DISABLE_DEBUG_STACKTRACE DebugStacktrace "Build with Debug Stacktracing") define_debug_option(RTS_DEBUG_PROFILE DEBUG_PROFILE DISABLE_DEBUG_PROFILE DebugProfile "Build with Debug Profiling") -define_debug_option(RTS_DEBUG_CHEATS _ALLOW_DEBUG_CHEATS_IN_RELEASE DISABLE_DEBUG_CHEATS_IN_RELEASE DebugCheats "Build with Debug Cheats") +add_feature_info(DebugCheats RTS_DEBUG_CHEATS "Build with Debug Cheats in release builds") add_feature_info(DebugIncludeDebugLogInCrcLog RTS_DEBUG_INCLUDE_DEBUG_LOG_IN_CRC_LOG "Build with Debug Logging in CRC log") add_feature_info(DebugMultiInstance RTS_DEBUG_MULTI_INSTANCE "Build with Multi Client Instance support") +if(RTS_DEBUG_CHEATS) + target_compile_definitions(core_config INTERFACE _ALLOW_DEBUG_CHEATS_IN_RELEASE) +endif() + if(RTS_DEBUG_INCLUDE_DEBUG_LOG_IN_CRC_LOG) target_compile_definitions(core_config INTERFACE INCLUDE_DEBUG_LOG_IN_CRC_LOG) endif()