Skip to content

Conversation

@bobtista
Copy link

@bobtista bobtista commented Nov 13, 2025

Summary

Implements a CMake option RTS_DEBUG_CHEATS to control debug cheat availability in release builds, replacing the manual DONT_ALLOW_DEBUG_CHEATS_IN_RELEASE define in GameCommon.h.

Usage

# Enable debug cheats in release builds
cmake -DRTS_DEBUG_CHEATS=ON ..

# Disable debug cheats in release builds (default)
cmake -DRTS_DEBUG_CHEATS=OFF ..

@bobtista bobtista marked this pull request as ready for review December 3, 2025 05:16
@xezon xezon added Minor Severity: Minor < Major < Critical < Blocker Build Anything related to building, compiling Debug Is mostly debug functionality labels Jan 26, 2026
@bobtista bobtista force-pushed the bobtista/cmake-debug-cheats-option branch from 9719cfe to 458b33f Compare January 30, 2026 07:17
@greptile-apps
Copy link

greptile-apps bot commented Jan 30, 2026

Greptile Overview

Greptile Summary

This PR modernizes debug cheat configuration by replacing a manual header define with a proper CMake build option.

Changes

  • Removed the manual DONT_ALLOW_DEBUG_CHEATS_IN_RELEASE define from GameCommon.h
  • Added RTS_DEBUG_CHEATS CMake option (OFF by default) in config-debug.cmake
  • When enabled, defines _ALLOW_DEBUG_CHEATS_IN_RELEASE to unlock debug cheats in release builds

Behavior

The default behavior is preserved: debug cheats remain disabled in release builds unless explicitly enabled via -DRTS_DEBUG_CHEATS=ON. This replaces the previous approach of manually editing the header file to toggle the DONT_ prefix.

Confidence Score: 5/5

  • This PR is safe to merge - it's a clean refactoring with no functional changes to default behavior
  • The changes correctly preserve existing semantics while improving configurability. The default OFF state matches the previous behavior of disallowing debug cheats in release builds. The implementation follows existing CMake patterns in the file.
  • No files require special attention

Important Files Changed

Filename Overview
Core/GameEngine/Include/Common/GameCommon.h Removed manual DONT_ALLOW_DEBUG_CHEATS_IN_RELEASE define - now controlled by CMake
cmake/config-debug.cmake Added RTS_DEBUG_CHEATS option (OFF by default) that defines _ALLOW_DEBUG_CHEATS_IN_RELEASE when enabled

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant CMake as CMake Build System
    participant Config as config-debug.cmake
    participant Target as core_config
    participant Code as Game Code

    Dev->>CMake: cmake -DRTS_DEBUG_CHEATS=OFF (default)
    CMake->>Config: Process config-debug.cmake
    Config->>Config: Check RTS_DEBUG_CHEATS option
    Note over Config: RTS_DEBUG_CHEATS=OFF
    Config-->>Target: No _ALLOW_DEBUG_CHEATS_IN_RELEASE defined
    Target->>Code: Compile without debug cheats
    Note over Code: Debug cheats disabled in release

    Dev->>CMake: cmake -DRTS_DEBUG_CHEATS=ON
    CMake->>Config: Process config-debug.cmake
    Config->>Config: Check RTS_DEBUG_CHEATS option
    Note over Config: RTS_DEBUG_CHEATS=ON
    Config->>Target: Define _ALLOW_DEBUG_CHEATS_IN_RELEASE
    Target->>Code: Compile with debug cheats
    Note over Code: Debug cheats enabled in release
Loading

@xezon
Copy link

xezon commented Jan 30, 2026

@greptileai

Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@xezon xezon changed the title build(debug): add CMake option for debug cheats in release builds build(debug): Add CMake option RTS_DEBUG_CHEATS to enable debug cheats in release builds Jan 30, 2026
@xezon xezon merged commit 002b8cb into TheSuperHackers:main Jan 30, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build Anything related to building, compiling Debug Is mostly debug functionality Minor Severity: Minor < Major < Critical < Blocker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement CMake option for _ALLOW_DEBUG_CHEATS_IN_RELEASE

2 participants