Skip to content

build(cmake): Add retail compatibility option in CMake config - #2379

Open
tintinhamans wants to merge 2 commits into
TheSuperHackers:mainfrom
tintinhamans:arctic/build-no-retail
Open

build(cmake): Add retail compatibility option in CMake config#2379
tintinhamans wants to merge 2 commits into
TheSuperHackers:mainfrom
tintinhamans:arctic/build-no-retail

Conversation

@tintinhamans

@tintinhamans tintinhamans commented Mar 2, 2026

Copy link
Copy Markdown

This pull request adds RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME configuration option to cmake/config-build.cmake to make it easier to build retail or non-retail.

Will eventually be used for #2322

@greptile-apps

greptile-apps Bot commented Mar 2, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds a default-enabled CMake option for retail-compatible game logic and reports it through CMake’s feature summary.

  • Disabling the option propagates seven RETAIL_COMPATIBLE_* compile definitions through core_config.
  • The definitions select non-retail CRC, save-transfer, pathfinding, circle-fill, networking, and AI-group behavior.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
cmake/config-build.cmake Adds and advertises the retail-compatibility option, applying opt-out compile definitions through the shared interface configuration target.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Option[RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME] --> Enabled{Enabled?}
  Enabled -->|Yes| Defaults[Use retail-compatible header defaults]
  Enabled -->|No| CoreConfig[Set compatibility macros to 0 on core_config]
  CoreConfig --> Shared[Shared Core target configuration]
  Shared --> Generals[Generals targets]
  Shared --> ZeroHour[GeneralsMD targets]
Loading

Reviews (2): Last reviewed commit: "build(cmake): Group retail compatibility..." | Re-trigger Greptile

@tintinhamans
tintinhamans requested a review from bobtista March 2, 2026 15:39
@bobtista

bobtista commented Mar 2, 2026

Copy link
Copy Markdown

Looks good to me, is there a reason we're not just adding ALL of the gamedefines macros? eg USE_BUFFERED_IO, USE_OBSOLETE_GENERALS_CODE, TELL_COMPUTER_IDENTITY_IN_LAN_LOBBY.

Also, maybe it's pedantic, but RTS_BUILD_OPTION_RETAIL_COMPATIBLE_PATHFINDING_ALLOCATION is probably a CMakeDependentOption of RTS_BUILD_OPTION_RETAIL_COMPATIBLE_PATHFINDING. Not needed though, this works as is.

Comment thread cmake/config-build.cmake Outdated
@xezon xezon added the Build Anything related to building, compiling label Mar 2, 2026
@bobtista

Copy link
Copy Markdown

Should we revive this one? Are we using RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME? adding ALL of the gamedefines macros? If the individual switches remain, PATHFINDING_ALLOCATION should be dependent on PATHFINDING, and CI should compile at least one non-default configuration.

…nfig-build.cmake

Signed-off-by: tintinhamans <5984296+tintinhamans@users.noreply.github.com>
@tintinhamans
tintinhamans force-pushed the arctic/build-no-retail branch from b3fca3b to 00cb6c5 Compare August 28, 2026 16:11
@tintinhamans

Copy link
Copy Markdown
Author

Revived and simplified this based on the feedback.

The individual switches have been replaced with a single RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME option. Disabling it turns off all current RETAIL_COMPATIBLE_* defines.

I realized I didn't need to define every GameDefines.h macro as a CMake option because they can already be accessed with RTS_FLAGS.

@tintinhamans tintinhamans changed the title build(cmake): Add retail compatibility options and features in CMake config build(cmake): Add retail compatibility option in CMake config Aug 28, 2026
@tintinhamans
tintinhamans requested review from Mauller and xezon August 28, 2026 16:13
@bobtista

Copy link
Copy Markdown

Should we have at least one of the RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME set to OFF for ci?

@tintinhamans

Copy link
Copy Markdown
Author

Should we have at least one of the RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME set to OFF for ci?

Was planning on doing that in a follow-up PR.

@xezon xezon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Makes sense.

Comment thread cmake/config-build.cmake
option(RTS_BUILD_OPTION_ASAN "Build code with Address Sanitizer." OFF)
option(RTS_BUILD_OPTION_VC6_FULL_DEBUG "Build VC6 with full debug info." OFF)
option(RTS_BUILD_OPTION_FFMPEG "Enable FFmpeg support" OFF)
option(RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME "Build with retail-compatible game logic." ON)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can clarify that disabling this will make the game benefit from the full wrath of fixes.

@xezon

xezon commented Sep 5, 2026

Copy link
Copy Markdown

Has unaddressed comments. Needs rebase

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants