Skip to content

build(gamememory): Simplify cmake and file setup for GameMemory files - #3467

Open
xezon wants to merge 1 commit into
TheSuperHackers:mainfrom
xezon:xezon/build-memory-null
Open

xezon wants to merge 1 commit into
TheSuperHackers:mainfrom
xezon:xezon/build-memory-null

Conversation

@xezon

@xezon xezon commented Oct 10, 2026

Copy link
Copy Markdown

This change simplifies the cmake and file setup for GameMemory files.

What it gives

  • All GameMemory files are now always part of the Visual Studio solution (not hidden)
  • GameMemoryNull.h is renamed to GameMemoryNull.inl because it really is that

@xezon xezon added Build Anything related to building, compiling Refactor Edits the code with insignificant behavior changes, is never user facing Memory Is memory related labels Oct 10, 2026
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ac8041cf-a003-413a-9b99-7d8e5b9d7dc6

📥 Commits

Reviewing files that changed from the base of the PR and between ac4965a and 0e3aa76.


📒 Files selected for processing (8)
  • Core/GameEngine/CMakeLists.txt
  • Core/GameEngine/Include/Common/GameMemory.h
  • Core/GameEngine/Include/Common/GameMemoryNull.inl
  • Core/GameEngine/Source/Common/System/GameMemory.cpp
  • Core/GameEngine/Source/Common/System/GameMemoryInit.cpp
  • Core/GameEngine/Source/Common/System/GameMemoryNull.cpp
  • Generals/Code/GameEngine/CMakeLists.txt
  • GeneralsMD/Code/GameEngine/CMakeLists.txt

💤 Files with no reviewable changes (2)
  • GeneralsMD/Code/GameEngine/CMakeLists.txt
  • Generals/Code/GameEngine/CMakeLists.txt

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.



Walkthrough

Game memory source files are listed directly in the core build configuration. Compile-time guards control whether the enabled or null memory implementation is compiled. The null implementation is now included through GameMemory.h.

Changes

Game memory selection

Layer / File(s) Summary
Memory implementation guards
Core/GameEngine/Include/Common/GameMemory.h, Core/GameEngine/Include/Common/GameMemoryNull.inl, Core/GameEngine/Source/Common/System/GameMemory.cpp, Core/GameEngine/Source/Common/System/GameMemoryInit.cpp, Core/GameEngine/Source/Common/System/GameMemoryNull.cpp
GameMemory.h includes GameMemoryNull.inl with a temporary inclusion marker when DISABLE_GAMEMEMORY is defined. The enabled and null implementation files are guarded by that macro. The null implementation's new-operator block also checks DISABLE_GAMEMEMORY_NEW_OPERATORS.
Build source lists
Core/GameEngine/CMakeLists.txt, Generals/Code/GameEngine/CMakeLists.txt, GeneralsMD/Code/GameEngine/CMakeLists.txt
The core CMake file lists memory implementation sources and GameMemoryNull.inl directly. The Generals and GeneralsMD CMake files remove conditional blocks that contained commented-out memory source entries.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Other

Suggested reviewers: bobtista

Merge Risk: ⚪ Minimal · up to 0e3aa

The unconditional source listing preserves the enabled/null implementation selection; no merge-blocking issue was identified.

Pre-merge checks | Passed 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: simplifying the CMake and file setup for GameMemory files.
Description check Passed The description directly explains the GameMemory CMake and file setup changes, including Visual Studio visibility and the rename to GameMemoryNull.inl.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[High impact] The PR appears safe to merge; no actionable issues were found.

Summary

Moves memory implementation selection from CMake source lists into C++ guards, keeping all memory files visible in the Visual Studio solution.

  • GameMemory files stay visible while the build flag picks the active implementation.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[All memory files listed in CMake] --> B{DISABLE_GAMEMEMORY defined?}
  B -- No --> C[GameMemory.cpp and GameMemoryInit.cpp active]
  B -- Yes --> D[GameMemoryNull.cpp active]
  D --> E[GameMemory.h includes GameMemoryNull.inl]
Loading

Reviews (1) · Last reviewed commit: "build(gamememory): Simplify cmake and fi..." · Reviewed by Greptile

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 Memory Is memory related Refactor Edits the code with insignificant behavior changes, is never user facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant