Skip to content

Commit 002b8cb

Browse files
authored
build(debug): Add CMake option RTS_DEBUG_CHEATS to enable debug cheats in release builds (TheSuperHackers#1842)
1 parent 7747434 commit 002b8cb

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Core/GameEngine/Include/Common/GameCommon.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747

4848
#pragma once
4949

50-
#define DONT_ALLOW_DEBUG_CHEATS_IN_RELEASE ///< Take of the DONT to get cheats back in to release
51-
5250
//#define _CAMPEA_DEMO
5351

5452
// ----------------------------------------------------------------------------------------------

cmake/config-debug.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ set_property(CACHE RTS_DEBUG_STACKTRACE PROPERTY STRINGS DEFAULT ON OFF)
1010
set(RTS_DEBUG_PROFILE "DEFAULT" CACHE STRING "Enables debug profiling. When DEFAULT, this option is enabled with DEBUG or INTERNAL")
1111
set_property(CACHE RTS_DEBUG_PROFILE PROPERTY STRINGS DEFAULT ON OFF)
1212

13+
option(RTS_DEBUG_CHEATS "Enables debug cheats in release builds" OFF)
1314
option(RTS_DEBUG_INCLUDE_DEBUG_LOG_IN_CRC_LOG "Includes normal debug log in crc log" OFF)
1415
option(RTS_DEBUG_MULTI_INSTANCE "Enables multi client instance support" OFF)
1516

@@ -35,10 +36,15 @@ define_debug_option(RTS_DEBUG_CRASHING DEBUG_CRASHING DISABLE_DEBUG_CRASHING
3536
define_debug_option(RTS_DEBUG_STACKTRACE DEBUG_STACKTRACE DISABLE_DEBUG_STACKTRACE DebugStacktrace "Build with Debug Stacktracing")
3637
define_debug_option(RTS_DEBUG_PROFILE DEBUG_PROFILE DISABLE_DEBUG_PROFILE DebugProfile "Build with Debug Profiling")
3738

39+
add_feature_info(DebugCheats RTS_DEBUG_CHEATS "Build with Debug Cheats in release builds")
3840
add_feature_info(DebugIncludeDebugLogInCrcLog RTS_DEBUG_INCLUDE_DEBUG_LOG_IN_CRC_LOG "Build with Debug Logging in CRC log")
3941
add_feature_info(DebugMultiInstance RTS_DEBUG_MULTI_INSTANCE "Build with Multi Client Instance support")
4042

4143

44+
if(RTS_DEBUG_CHEATS)
45+
target_compile_definitions(core_config INTERFACE _ALLOW_DEBUG_CHEATS_IN_RELEASE)
46+
endif()
47+
4248
if(RTS_DEBUG_INCLUDE_DEBUG_LOG_IN_CRC_LOG)
4349
target_compile_definitions(core_config INTERFACE INCLUDE_DEBUG_LOG_IN_CRC_LOG)
4450
endif()

0 commit comments

Comments
 (0)