|
1 |
| -# Building in CLion with a VC6 \(x86\) Toolchain |
| 1 | +# Compile Command & Conquer Generals And Zero Hour with VC6 in CLion |
| 2 | + |
| 3 | +This guide shows how to configure CLion to work with the Visual Studio 6.0 toolchain, maintaining |
| 4 | +compatibility with the original compiler from the game's development era. To compile the source code for |
| 5 | +**Command & Conquer: Generals** and **Zero Hour** using the CLion IDE, follow the steps outlined below. |
2 | 6 |
|
3 | 7 | ## Prerequisites
|
4 | 8 |
|
5 |
| -1. **CLion** installed and configured. |
6 |
| -2. **Microsoft Visual C++ 6.0 (VC6)** installed (assuming it’s installed in the |
7 |
| - default directory). |
8 |
| -3. **Source code** of the project cloned from the TheSuperHackers repository. |
| 9 | +- [Visual Studio 6.0 Portable](https://github.com/itsmattkc/MSVC600) |
| 10 | +- [CLion](https://www.jetbrains.com/clion/) |
| 11 | +- [Source Code](https://github.com/TheSuperHackers/GeneralsGameCode) of the project cloned from the TheSuperHackers repository |
| 12 | + |
| 13 | +> For simplicity, this guide assumes the user will be using the |
| 14 | +> default install folder for Visual Studio 6.0 Portable: `C:\Program Files (x86)\Microsoft Visual Studio\` |
9 | 15 |
|
10 | 16 | ## Step 1: Setting Up the Toolchain in CLion
|
11 | 17 |
|
12 |
| -1. Open the cloned folder in **CLion** and go to **File** -> **Settings** -> **Build, Execution, |
13 |
| - Deployment** -> **Toolchains**. |
| 18 | +1. Open the cloned folder in **CLion** and go to **File** → **Settings** → **Build, Execution, |
| 19 | + Deployment** → **Toolchains**. |
14 | 20 | 2. Add a new **Toolchain** by clicking the **+** button.
|
15 |
| -3. Select **System** as the Type (not Visual Studio). |
16 |
| -4. Rename the toolchain to **Visual Studio 6** |
| 21 | +3. Select **System** as the type (not Visual Studio). |
| 22 | +4. Rename the toolchain to **Visual Studio 6**. |
17 | 23 | 5. Next to the toolchain name, add the **environment** file by clicking the
|
18 | 24 | **+** button and pointing to the following file:
|
19 | 25 |
|
20 | 26 | ```text
|
21 | 27 | C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT
|
22 | 28 | ```
|
23 | 29 |
|
| 30 | + > **Warning**: Make sure to change the file extension from `.BAT` to `.bat` (lowercase) in the path to the |
| 31 | + > environment file in the CLion toolchains window, otherwise CLion may have issues detecting the environment |
| 32 | + > for some reason. |
| 33 | +
|
24 | 34 | 6. Set the paths for the tools:
|
25 |
| - - **Build Tool**: Choose the `NMAKE.EXE` file from VC6. For example: |
| 35 | + - **Build Tool**: Choose the `NMAKE.EXE` file from VC6. For example: |
26 | 36 |
|
27 |
| - ```text |
28 |
| - C:/Program Files (x86)/Microsoft Visual Studio/VC98/Bin/NMAKE.EXE |
29 |
| - ``` |
| 37 | + ```text |
| 38 | + C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\NMAKE.EXE |
| 39 | + ``` |
30 | 40 |
|
31 |
| - - **C Compiler**: The `cl.exe` should be detected automatically. If not, set |
32 |
| - it manually to: |
| 41 | + - **C Compiler**: The `cl.exe` should be detected automatically. If not, set |
| 42 | + it manually to: |
33 | 43 |
|
34 |
| - ```text |
35 |
| - C:/Program Files (x86)/Microsoft Visual Studio/VC98/Bin/cl.exe |
36 |
| - ``` |
| 44 | + ```text |
| 45 | + C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\cl.exe |
| 46 | + ``` |
37 | 47 |
|
38 |
| - - **C++ Compiler**: The `cl.exe` will also be detected automatically. |
| 48 | + - **C++ Compiler**: The `cl.exe` will also be detected automatically. |
39 | 49 |
|
40 |
| -## Step 2: Configuring the CMake Profile |
| 50 | + |
41 | 51 |
|
42 |
| -1. In Cmake profiles, enable the profiles you want to use, like vc6, vc6dgb, vc6int, vc6prof. |
| 52 | +## Step 2: Configuring the CMake Profiles |
43 | 53 |
|
44 |
| -## step 3: Configuring the installation path |
| 54 | +1. In the CMake profiles, enable the profiles you want to use. The available workflow presets are: |
| 55 | + - `vc6` - Release build |
| 56 | + - `vc6-debug` - Debug build |
| 57 | + - `vc6-internal` - Internal build |
| 58 | + - `vc6-profile` - Profile build |
| 59 | +
|
| 60 | + For detailed information about each build configuration and their specific purposes, see the [Build Configurations Overview](https://github.com/TheSuperHackers/GeneralsGameCode/wiki/build_configuration). |
| 61 | +
|
| 62 | +## Step 3: Configuring the Installation Path |
45 | 63 |
|
46 | 64 | 1. In the target application options, do the following:
|
47 | 65 |
|
48 |
| -- Set Program arguments with your favorite arguments,like `-win, -quickstart, -nologo`. |
49 |
| -- Set Working directory to the game directory. |
50 |
| -- Check the run as administrator option. |
51 |
| -- In 'Before launch' section, add a new 'install' step. |
52 |
| -- To avoid duplication build, remove the 'Build' step. |
53 |
| -- Save the configuration, and you are ready to build and run the project. |
| 66 | + - Set **Program arguments** with your preferred command line arguments, such as `-win`, `-quickstart`, etc. |
| 67 | + - Set **Working directory** to the game directory. |
| 68 | + - Check the **Run as administrator** option. |
| 69 | + - In the **Before launch** section, add a new **install** step. |
| 70 | + - To avoid duplicate builds, remove the **Build** step. |
| 71 | + - Save the configuration, and you are ready to build and run the project. |
54 | 72 |
|
55 | 73 | ## Step 4: Compiling and Running the Project
|
56 | 74 |
|
57 |
| -1. Now, click the **Build** button in CLion, or click **Install** in build menu. |
| 75 | +1. Now, click the **Build** button in CLion, or click **Install** in the build menu. |
58 | 76 | 2. CLion will start the build/install process using the VC6 (x86) toolchain.
|
59 |
| -3. Once the build is successfully completed, a executable file will be generated (and installed in the game directory). |
60 |
| -
|
61 |
| ---- |
| 77 | +3. Once the build is successfully completed, an executable file will be generated and installed in the |
| 78 | + game directory. |
62 | 79 |
|
63 | 80 | ## Notes
|
64 | 81 |
|
65 |
| -- Working with VC6 requires some adjustments, so it’s always a good idea to check |
| 82 | +- Working with VC6 requires some adjustments, so it’s a good idea to verify |
66 | 83 | that the toolchain is working properly.
|
67 | 84 | - You can add Release and Debug profiles in CLion to build the project in
|
68 | 85 | different configurations.
|
69 |
| -- Admin rights might be required to run VC6 tools, so make sure to run CLion as an administrator if needed. |
| 86 | +- Administrator rights may be required to run VC6 tools, so run CLion as an administrator if |
| 87 | + needed. |
0 commit comments