You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the script comments and usage section, it says that ./scripts/docker-build.sh --target generalszh should be used to build Generals ZH. As no such target exists, the build fails with ninja: error: unknown target 'generalszh'. Moreover, the script allows to build both generalszh.exe and the ZH tools via --game zh instead of --target but it derives the wrong targets if that option is used. Thus, this PR fixes the script to set the correct targets and updates the comment and usage sections accordingly.
I also want to note that there is a wiki page describing how to use the docker-build.sh script. This will need to be updated as well. From what I can see, it would be sufficient to replace --target generalszh with --target z_generals. However, I would suggest removing these instructions from the wiki page and instead referring to the usage section of the script to improve maintainability.
This PR fixes the docker-build.sh script by replacing incorrect CMake target names (generalszh, generalszh_tools, generalsv_tools) with the actual targets defined in the CMakeLists (z_generals, g_generals, plus the full list of tool targets). The fix aligns the --game derived targets, inline help text, and usage examples with the real build system. The previously flagged stale generalszh example in the -t/--target option description (line 62) has been corrected in this PR.
Confidence Score: 5/5
Safe to merge — all changes are documentation and target-name corrections in a build helper script.
No logic errors introduced; the new target names are confirmed valid against the CMakeLists files in the repo. The previously reported P1 (stale generalszh in the -t/--target description) is already resolved in this diff.
No files require special attention.
Important Files Changed
Filename
Overview
scripts/docker-build.sh
Corrects all CMake target references: updates usage comments, help text examples, and the derived target lists for --game zh and --game generals to match actual CMakeLists-defined targets; g_wdump is correctly absent (no such target exists in the Generals subdirectory).
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[docker-build.sh invoked] --> B{--target set?}
B -- Yes --> E[Use explicit TARGET]
B -- No --> C{--game value}
C -- zh/zerohour --> D1["TARGET = z_generals z_worldbuilder\ncore_particleeditor core_debugwindow\nz_guiedit z_imagepacker\nz_mapcachebuilder z_w3dview z_wdump"]
C -- generals --> D2["TARGET = g_generals g_worldbuilder\ncore_particleeditor core_debugwindow\ng_guiedit g_imagepacker\ng_mapcachebuilder g_w3dview"]
C -- all --> D3["TARGET = (empty = build all)"]
D1 --> E
D2 --> E
D3 --> E
E --> F[docker run zerohour-build with MAKE_TARGET]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BuildAnything related to building, compilingPlatformWork towards platform support, such as Linux, MacOS
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates to #2085
In the script comments and usage section, it says that
./scripts/docker-build.sh --target generalszhshould be used to build Generals ZH. As no such target exists, the build fails withninja: error: unknown target 'generalszh'. Moreover, the script allows to build bothgeneralszh.exeand the ZH tools via--game zhinstead of--targetbut it derives the wrong targets if that option is used. Thus, this PR fixes the script to set the correct targets and updates the comment and usage sections accordingly.I also want to note that there is a wiki page describing how to use the
docker-build.shscript. This will need to be updated as well. From what I can see, it would be sufficient to replace--target generalszhwith--target z_generals. However, I would suggest removing these instructions from the wiki page and instead referring to the usage section of the script to improve maintainability.