Skip to content

Updated build guides for vc6 with cmake and clion with vc6. Also added notice about debug builds #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions SourceCode/Builds/build_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ There are four main build configurations in the project, each designed for diffe

- **Use Case:** Used during development for debugging and resolving issues in the code.

> **⚠️ Debug Build Requirements:** To run a debug build of the game, you need to have
> the following two files in the game directory alongside the built executable:
>
> - [`MSVCRTD.DLL`](https://github.com/TheSuperHackers/GeneralsWiki/raw/refs/heads/main/SourceCode/Builds/files/MSVCRTD.DLL)
> Microsoft Visual C++ Runtime Library (Debug)
> - [`MSVCIRTD.DLL`](https://github.com/TheSuperHackers/GeneralsWiki/raw/refs/heads/main/SourceCode/Builds/files/MSVCIRTD.DLL)
> Microsoft Visual C++ Internationalization Runtime Library (Debug)
### 3. **Profile (O2, IG_DEBUG_STACKTRACE, _RELEASE, _PROFILE)**

- **Purpose:** The profile configuration is used for performance profiling and optimization. It is designed to help
Expand Down
8 changes: 8 additions & 0 deletions SourceCode/Builds/build_guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ Each configuration is designed for a different purpose, whether you're building
releasing the final product. You can find more details about the build configurations in
the [Build Configurations](build_configuration) page.

> **⚠️ Debug Build Requirements:** To run a debug build of the game, you need to have
> the following two files in the game directory alongside the built executable:
>
> - [`MSVCRTD.DLL`](https://github.com/TheSuperHackers/GeneralsWiki/raw/refs/heads/main/SourceCode/Builds/files/MSVCRTD.DLL)
> Microsoft Visual C++ Runtime Library (Debug)
> - [`MSVCIRTD.DLL`](https://github.com/TheSuperHackers/GeneralsWiki/raw/refs/heads/main/SourceCode/Builds/files/MSVCIRTD.DLL)
> Microsoft Visual C++ Internationalization Runtime Library (Debug)
## Architectures and Toolchains

The project supports multiple architectures and toolchains, which is why there are various build guides tailored to
Expand Down
35 changes: 29 additions & 6 deletions SourceCode/Builds/build_with_clion_vc6_toolchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,28 @@ compatibility with the original compiler from the game's development era. To com
## Prerequisites

- [Visual Studio 6.0 Portable](https://github.com/itsmattkc/MSVC600)
> See the [Visual Studio 6.0 Portable installation instructions](build_with_msvc6.md#visual-studio-60-portable)
> for setup details.
- [CLion](https://www.jetbrains.com/clion/)
- [Source Code](https://github.com/TheSuperHackers/GeneralsGameCode) of the project cloned from the TheSuperHackers repository

> For simplicity, this guide assumes the user will be using the
> default install folder for Visual Studio 6.0 Portable: `C:\Program Files (x86)\Microsoft Visual Studio\`
## Step 1: Setting Up the Toolchain in CLion
## Step 1: Clone and Open the Project

1. Open the cloned folder in **CLion** and go to **File****Settings****Build, Execution,
1. Clone the source code from TheSuperHackers:

```shell
git clone https://github.com/TheSuperHackers/GeneralsGameCode.git
```

> Alternatively, you can clone the repository directly from within CLion.
2. Open the cloned folder in **CLion**.

## Step 2: Setting Up the Toolchain in CLion

1. In CLion, go to **File****Settings****Build, Execution,
Deployment****Toolchains**.
2. Add a new **Toolchain** by clicking the **+** button.
3. Select **System** as the type (not Visual Studio).
Expand Down Expand Up @@ -49,7 +62,7 @@ compatibility with the original compiler from the game's development era. To com
![CLion VC6 Toolchain Configuration](https://github.com/TheSuperHackers/GeneralsWiki/raw/refs/heads/main/SourceCode/Builds/files/clionvc6toolchain.png)
## Step 2: Configuring the CMake Profiles
## Step 3: Configuring the CMake Profiles
1. In the CMake profiles, enable the profiles you want to use. The available workflow presets are:
- `vc6` - Release build
Expand All @@ -58,7 +71,7 @@ compatibility with the original compiler from the game's development era. To com
For detailed information about each build configuration and their specific purposes, see the [Build Configurations Overview](https://github.com/TheSuperHackers/GeneralsGameCode/wiki/build_configuration).
## Step 3: Configuring the Installation Path
## Step 4: Configuring the Installation Path
1. In the target application options, do the following:
Expand All @@ -69,13 +82,23 @@ compatibility with the original compiler from the game's development era. To com
- To avoid duplicate builds, remove the **Build** step.
- Save the configuration, and you are ready to build and run the project.
## Step 4: Compiling and Running the Project
## Step 5: Compiling and Running the Project
1. Now, click the **Build** button in CLion, or click **Install** in the build menu.
2. CLion will start the build/install process using the VC6 (x86) toolchain.
3. Once the build is successfully completed, an executable file will be generated and installed in the
game directory.
## Running Debug Builds
> **⚠️ Debug Build Requirements:** To run a debug build of the game, you need to have
> the following two files in the game directory alongside the built executable:
>
> - [`MSVCRTD.DLL`](https://github.com/TheSuperHackers/GeneralsWiki/raw/refs/heads/main/SourceCode/Builds/files/MSVCRTD.DLL)
> Microsoft Visual C++ Runtime Library (Debug)
> - [`MSVCIRTD.DLL`](https://github.com/TheSuperHackers/GeneralsWiki/raw/refs/heads/main/SourceCode/Builds/files/MSVCIRTD.DLL)
> Microsoft Visual C++ Internationalization Runtime Library (Debug)
## Notes
- Working with VC6 requires some adjustments, so it’s a good idea to verify
Expand Down
96 changes: 74 additions & 22 deletions SourceCode/Builds/build_with_msvc6.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,60 @@ Even if you do not know C++, you should still be able to compile the source code
understanding of how C++ is compiled is necessary. This includes knowing what the **compiler** and
**linker** do, as well as being able to interpret error messages and troubleshoot them effectively.

## Prerequisites
## Prerequisites and setting up the build environment

Download the following binaries and software and have them ready in a project folder.
Download and install the following tools and software needed for compilation.

- [Visual Studio 6.0 Portable](https://github.com/itsmattkc/MSVC600)
- [CMake 3.31.6](https://github.com/Kitware/CMake/releases/download/v3.31.6/cmake-3.31.6-windows-x86_64.msi) or [newer](https://cmake.org/download/#latest)
- [Git](https://git-scm.com/downloads)

> For simplicity, this guide will use the installers for Git and CMake and assumes the user will use the
> **ℹ️ Setup Note:** For simplicity, this guide will use the installers for Git and CMake and assumes the user will use the
default install folder for Visual Studio 6.0 Portable.

## Installing your build environment
### Visual Studio 6.0 Portable

**Download:** [Visual Studio 6.0 Portable](https://github.com/itsmattkc/MSVC600)

Installation of tools and software that are needed for compilation.
The original compiler used for game development.

### Install Visual Studio 6
**Installation:**

- Download the portable Visual Studio 6 as a ZIP file from GitHub.
- Extract the common and VC98 folders from the downloaded archive to the default install folder.
- Download the portable Visual Studio 6 as a ZIP file from GitHub
- Extract the `common` and `VC98` folders from the downloaded archive to the default install folder
- Default installation folder: `C:\Program Files (x86)\Microsoft Visual Studio\`

> Alternatively, you can use the VC6 setup from Archive.org.
### Install CMake
### Git

**Download:** [Git](https://git-scm.com/downloads)

Required for cloning the source code repository.

**Installation:**

- Run the Git installer

### CMake *(added to system path)*

**Download:** [CMake 3.31.6](https://github.com/Kitware/CMake/releases/download/v3.31.6/cmake-3.31.6-windows-x86_64.msi)
or [newer](https://cmake.org/download/#latest)

- Run the installer for CMake.
- Enable the option to add CMake to the system path during the setup wizard.
> **Note:** Not required if using IDEs like CLion or Visual Studio 2022, as these include built-in CMake support.
### Install Git
**Installation:**

- Run the Git installer.
- Run the installer for CMake
- Enable the option to add CMake to the system path during the setup wizard

### Ninja *(added to system path)*

**Download:** [Ninja](https://ninja-build.org/)

> **Note:** Not required if using IDEs like CLion or Visual Studio 2022, as these include a bundled ninja binary.
**Installation:**

- Download the Ninja binary from the [Ninja releases page](https://ninja-build.org/)
- Extract the `ninja.exe` file to a folder of your choice
- Add the folder containing `ninja.exe` to your system's PATH environment variable

## Clone

Expand Down Expand Up @@ -117,18 +140,47 @@ set MSVCDir=C:\<VS6_INSTALL_PATH>\VC98

Run the following command based on the type of build you want to create:

- `cmake --workflow --preset vc6` for a release build.
- `cmake --workflow --preset vc6-debug` for a debug build.
- `cmake --workflow --preset vc6-profile` for a profile build.
- For a release build:

``` shell
cmake --workflow --preset vc6
```

- For a debug build:

``` shell
cmake --workflow --preset vc6-debug
```

- For a profile build:

``` shell
cmake --workflow --preset vc6-profile
```

You will find a bunch of files in `build\vc6\<game name>` and a file called `generalszh.exe` or `generalsv.exe`.

For detailed information about each build configuration and their specific purposes, see the [Build Configurations Overview](https://github.com/TheSuperHackers/GeneralsGameCode/wiki/build_configuration).

### Install the game executable

Run ```cmake --install build\<vc6 build type>```, this will copy the executable to the retail game directory,
or you can copy it manually.
Run the following command to copy the executable to the retail game directory:

``` shell
cmake --install build\<vc6 build type>
```

Alternatively, you can copy it manually.

### Running Debug Builds

> **⚠️ Debug Build Requirements:** To run a debug build of the game, you need to copy
> the following two files into the game directory alongside the built executable:
>
> - [`MSVCRTD.DLL`](https://github.com/TheSuperHackers/GeneralsWiki/raw/refs/heads/main/SourceCode/Builds/files/MSVCRTD.DLL)
> Microsoft Visual C++ Runtime Library (Debug)
> - [`MSVCIRTD.DLL`](https://github.com/TheSuperHackers/GeneralsWiki/raw/refs/heads/main/SourceCode/Builds/files/MSVCIRTD.DLL)
> Microsoft Visual C++ Internationalization Runtime Library (Debug)
## Troubleshooting

Expand Down
Binary file added SourceCode/Builds/files/MSVCIRTD.DLL
Binary file not shown.
Binary file added SourceCode/Builds/files/MSVCRTD.DLL
Binary file not shown.