Skip to content

build(cmake): Add output name settings for Generals and Zero Hour executables#2378

Open
tintinhamans wants to merge 1 commit intoTheSuperHackers:mainfrom
tintinhamans:arctic/cmake-exe-name
Open

build(cmake): Add output name settings for Generals and Zero Hour executables#2378
tintinhamans wants to merge 1 commit intoTheSuperHackers:mainfrom
tintinhamans:arctic/cmake-exe-name

Conversation

@tintinhamans
Copy link

@tintinhamans tintinhamans commented Mar 2, 2026

This pull request improves the flexibility of the build system by allowing the output binary names for the Generals and Zero Hour executables to be customized at configure time - this can be helpful if you have multiple worktrees and want to use the install target.

This is achieved by introducing new CMake cache variables, making it easier to override the default output names without modifying the build scripts directly.

Build system improvements:

  • Added RTS_BUILD_ZEROHOUR_OUTPUT_NAME and RTS_BUILD_GENERALS_OUTPUT_NAME CMake cache variables with default values (generalszh and generalsv respectively) to allow customizable output binary names for Zero Hour and Generals executables. (cmake/config-build.cmake).

@tintinhamans tintinhamans requested a review from OmniBlade March 2, 2026 14:57
@greptile-apps
Copy link

greptile-apps bot commented Mar 2, 2026

Greptile Summary

Introduces configurable output binary names for Generals and Zero Hour executables via CMake cache variables RTS_BUILD_GENERALS_OUTPUT_NAME and RTS_BUILD_ZEROHOUR_OUTPUT_NAME.

  • Removes redundant if-else blocks that set identical output names in both Windows and non-Windows branches
  • Adds cache variables with defaults matching previous hard-coded values (generalsv and generalszh)
  • Updates comments to reference variable names instead of hard-coded binary names
  • Variables are properly scoped within their respective conditional blocks
  • Enables customization at configure time via -DRTS_BUILD_GENERALS_OUTPUT_NAME=CustomName

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • Clean refactoring that removes redundant code, adds useful configurability, maintains backward compatibility with identical default values, and properly scopes variables within conditional blocks
  • No files require special attention

Important Files Changed

Filename Overview
cmake/config-build.cmake Added cache variables for customizable output names (generalszh, generalsv) with proper scoping inside conditional blocks
Generals/Code/Main/CMakeLists.txt Removed redundant if-else block and replaced with configurable OUTPUT_NAME variable, updated comment to reflect variable usage
GeneralsMD/Code/Main/CMakeLists.txt Removed redundant if-else block and replaced with configurable OUTPUT_NAME variable, updated comment to reflect variable usage

Last reviewed commit: 1c82474

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link

greptile-apps bot commented Mar 2, 2026

Additional Comments (2)

Generals/Code/Main/CMakeLists.txt
Stale hardcoded filename in comment

This comment still references the default output name generalsv directly. If a user overrides RTS_BUILD_GENERALS_OUTPUT_NAME at configure time, the actual debug file will have a different name, making this comment misleading.

# This creates ${RTS_BUILD_GENERALS_OUTPUT_NAME}.exe.debug (similar to MSVC .pdb files)
Prompt To Fix With AI
This is a comment left during a code review.
Path: Generals/Code/Main/CMakeLists.txt
Line: 87

Comment:
**Stale hardcoded filename in comment**

This comment still references the default output name `generalsv` directly. If a user overrides `RTS_BUILD_GENERALS_OUTPUT_NAME` at configure time, the actual debug file will have a different name, making this comment misleading.

```suggestion
# This creates ${RTS_BUILD_GENERALS_OUTPUT_NAME}.exe.debug (similar to MSVC .pdb files)
```

How can I resolve this? If you propose a fix, please make it concise.

GeneralsMD/Code/Main/CMakeLists.txt
Stale hardcoded filename in comment

This comment still references the default output name generalszh directly. If a user overrides RTS_BUILD_ZEROHOUR_OUTPUT_NAME at configure time, the actual debug file will have a different name, making this comment misleading.

# This creates ${RTS_BUILD_ZEROHOUR_OUTPUT_NAME}.exe.debug (similar to MSVC .pdb files)
Prompt To Fix With AI
This is a comment left during a code review.
Path: GeneralsMD/Code/Main/CMakeLists.txt
Line: 76

Comment:
**Stale hardcoded filename in comment**

This comment still references the default output name `generalszh` directly. If a user overrides `RTS_BUILD_ZEROHOUR_OUTPUT_NAME` at configure time, the actual debug file will have a different name, making this comment misleading.

```suggestion
# This creates ${RTS_BUILD_ZEROHOUR_OUTPUT_NAME}.exe.debug (similar to MSVC .pdb files)
```

How can I resolve this? If you propose a fix, please make it concise.

…cutables

Signed-off-by: tintinhamans <5984296+tintinhamans@users.noreply.github.com>
@tintinhamans tintinhamans force-pushed the arctic/cmake-exe-name branch from 862861a to 1c82474 Compare March 2, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant