@@ -4,6 +4,12 @@ This guide will walk you through the process of basic setup and compilation of t
44code using Visual Studio 2022.
55For build using solutions and more advanced build configurations, see below.
66
7+ - [ Prerequisites] ( #prerequisites )
8+ - [ Build through Visual Studio 2022] ( #1-prepare-the-project )
9+ - [ Build through CMake target view] ( #build-through-cmake-target-view )
10+ - [ Build using command line] ( #build-using-command-line )
11+ - [ Troubleshooting] ( #troubleshooting )
12+
713## Prerequisites
814
9151 . ** Visual Studio 2022**
4147 - ` generalszh.exe ` to build Zero Hour.
4248
4349- Build the project by clicking on the ` Build ` menu and selecting ` Build ` .
44- - The compiled executable will be placed in the ` build/<win32 build type>/<game name (Generals/GeneralsMD)>/<build configuration> `
45- folder. Example: ` build/win32dgb/GeneralsMD/Debug `
50+ - The compiled executable will be placed in the build folder. Example: ` build/win32dgb/GeneralsMD/Debug `
4651- Install the game executable in the game directory by clicking on the ` Install ` in ` Build ` menu. This will copy the
4752 executable to the retail game directory.
4853
@@ -60,31 +65,45 @@ You need to install [CMake](https://cmake.org/download/) and [Ninja](https://git
6065to build the project from the command line.
6166
6267- In the developer command prompt, open the settings to add the x86 environment terminal.
63-
64- > [ !Tip]
65- > Alternatively, you can open the "x86 Native Tools Command Prompt for VS 2022" from the start menu,
66- > and navigate to the project directory in the terminal then run the commands below.
67-
6868- In the pop-up window, click on the 'Add' and set the following: (assuming default installation path)
6969 - Name: ` x86 Native Tools Command Prompt `
7070 - Shell Location: ` C:\Windows\System32\cmd.exe `
7171 - Arguments: ` /k "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat" `
7272- Now you can open the new terminal from the terminal dropdown list.
73- - Run the following commands to build the project:
74- - Choose the build configuration:
75- - ` cmake --workflow --preset win32 ` for Release build.
76- - ` cmake --workflow --preset win32dgb ` for Debug build.
77- - ` cmake --workflow --preset win32int ` for Internal build.
78- - ` cmake --workflow --preset win32prof ` for Profile build.
79- - Install the game executable in the game directory (assuming that the build was successful):
80- - ` cmake --install build/<preset name> `
81- - To build a specific target:
73+
74+ > [ !Tip]
75+ > Alternatively, you can skip the terminal setup and simply open the "x86 Native Tools Command Prompt for
76+ > VS 2022" from the Start menu. Once opened, navigate to the project directory in the terminal and proceed
77+ > to run the commands below.
78+
79+
80+ - #### 1. ** Release Build**
81+
82+ - ** Choose the build configuration:**
83+ - ` cmake --workflow --preset win32 ` for Release build.
84+
85+ - ** Install the game executable in the game directory (assuming the build was successful):**
86+ - ` cmake --install build/win32 --config Release `
87+
88+ - #### 2. ** Development and Debug Builds**
89+
90+ - ** Choose the build configuration:**
91+ - ` cmake --workflow --preset win32dgb ` for Debug build.
92+ - ` cmake --workflow --preset win32int ` for Internal build.
93+ - ` cmake --workflow --preset win32prof ` for Profile build.
94+
95+ - ** Install the game executable in the game directory (assuming the build was successful):**
96+ - ` cmake --install build/<preset name> `
97+
98+
99+ - ** To build a specific target:**
82100 - Run ` cmake --build build/<preset name> --target <target name> `
83- - Example: ` cmake --build build/win32 --target z_generals `
84- - Or: ` cmake --build build/win32 --target g_generals `
101+ - Example: ` cmake --build build/win32dgb --target z_generals `
102+ - Or: ` cmake --build build/win32int --target g_generals `
85103
86104## Troubleshooting
87105
88106- ** Missing DLLs?** Ensure that all required dependencies are installed.
89107- ** Game not launching?** Verify that all necessary ` .BIG ` files are correctly placed.
90- - ** Build errors?** Check Visual Studio settings and dependencies for any issues.
108+ - ** Build errors?** Check Visual Studio settings and dependencies for any issues or delete the ` build ` folder and try
109+ building again.
0 commit comments