Skip to content

Commit 898fd90

Browse files
Add build configurations and guides overview (#34)
* Add Build Configuration Overview * Add build guides * Fix links
1 parent 680c40b commit 898fd90

File tree

6 files changed

+212
-10
lines changed

6 files changed

+212
-10
lines changed
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Build Configurations Overview
2+
3+
This page describes the various build configurations used in the project, detailing the different types of builds, their
4+
purpose, and the associated compiler flags for each configuration. These configurations control how the code is compiled
5+
and optimized for different development and release scenarios.
6+
7+
## Build Configurations
8+
9+
There are four main build configurations in the project, each designed for different purposes:
10+
11+
### 1. **Release (O2, _RELEASE)**
12+
13+
- **Purpose:** The release configuration is used for building the final version of the game that will be distributed to
14+
end users.
15+
- **Features:**
16+
- Maximum optimization (`/O2`) for better performance.
17+
- No debugging information is included to ensure smaller binary size and improved performance.
18+
- Suitable for production builds.
19+
20+
- **Compiler Flags:**
21+
- `/O2`: Optimization for speed.
22+
- `/D "_RELEASE"`: Defines the release configuration.
23+
- `/D "NDEBUG"`: Disables debugging code.
24+
25+
- **Use Case:** This configuration is used when preparing the game for release to the end user.
26+
27+
### 2. **Debug (Od, _DEBUG)**
28+
29+
- **Purpose:** The debug configuration is used for development and debugging. It includes debugging symbols and disables
30+
optimizations to make it easier to step through code.
31+
- **Features:**
32+
- No optimization (`/Od`), making debugging easier but with slower execution.
33+
- Debugging symbols and additional information are included to help track issues.
34+
- The build is less efficient but provides full access to debugging features.
35+
36+
- **Compiler Flags:**
37+
- `/Od`: Disables optimizations to facilitate debugging.
38+
- `/D "_DEBUG"`: Defines the debug configuration.
39+
- `/ZI`: Generates debugging information.
40+
- `/Gm`: Enables minimal rebuilds.
41+
42+
- **Use Case:** Used during development for debugging and resolving issues in the code.
43+
44+
### 3. **Internal (O2, _INTERNAL)**
45+
46+
- **Purpose:** The internal configuration is used for internal development purposes, offering optimization and some
47+
debugging features to help developers while maintaining performance.
48+
- **Features:**
49+
- Combines optimization (`/O2`) for performance with limited debugging options.
50+
- Suitable for internal testing and development, where performance is important, but some debugging features are
51+
still needed.
52+
53+
- **Compiler Flags:**
54+
- `/O2`: Optimization for speed.
55+
- `/D "_INTERNAL"`: Defines the internal build configuration.
56+
- `/D "NDEBUG"`: Disables debugging in the final build.
57+
- `/Zi`: Generates debugging information.
58+
59+
- **Use Case:** Used for internal builds when developers need optimized performance but still want some debugging tools
60+
available.
61+
62+
### 4. **Profile (O2, IG_DEBUG_STACKTRACE, _RELEASE, _PROFILE)**
63+
64+
- **Purpose:** The profile configuration is used for performance profiling and optimization. It is designed to help
65+
developers analyze performance bottlenecks and gather performance data.
66+
- **Features:**
67+
- Includes optimization (`/O2`) and performance profiling flags.
68+
- Supports detailed stack tracing (`IG_DEBUG_STACKTRACE`) to gather performance metrics.
69+
- Designed for analyzing how the game performs under various conditions and measuring optimization effectiveness.
70+
71+
- **Compiler Flags:**
72+
- `/O2`: Optimization for performance.
73+
- `/D "_PROFILE"`: Enables profiling configuration.
74+
- `/D "IG_DEBUG_STACKTRACE"`: Enables stack trace debugging for performance analysis.
75+
- `/D "NDEBUG"`: Disables debugging code in the final build.
76+
77+
- **Use Case:** Used for profiling and performance analysis to optimize code and identify potential bottlenecks.
78+
79+
---
80+
81+
## Key Compiler Flags
82+
83+
Below is a list of the key compiler flags used across different configurations:
84+
85+
### Optimization Flags
86+
87+
- **`/O2`**: Optimizes the code for speed. This flag is typically used in release builds and performance profiling
88+
builds.
89+
- **`/Od`**: Disables optimizations, which is useful during debugging when you want to ensure that the debugger can
90+
easily track code execution.
91+
92+
### Debugging Flags
93+
94+
- **`/D "_DEBUG"`**: Defines the build as a debug version, enabling debugging-specific features in the code.
95+
- **`/D "_RELEASE"`**: Defines the build as a release version, disabling debugging features and optimizing for
96+
performance.
97+
- **`/D "_INTERNAL"`**: Marks the build as an internal version, which may include some debugging information while still
98+
being optimized for performance.
99+
- **`/D "NDEBUG"`**: Disables debugging code, typically used in release and internal builds.
100+
101+
### Profiling Flags
102+
103+
- **`/D "_PROFILE"`**: Enables performance profiling in the build. This flag is used to gather performance data during
104+
runtime.
105+
- **`/D "IG_DEBUG_STACKTRACE"`**: Enables stack trace generation, which helps in analyzing performance issues and
106+
crashes.
107+
108+
### Additional Flags
109+
110+
- **`/ZI`**: Generates debugging information and supports editing and continuing in Visual Studio.
111+
- **`/WX`**: Treats warnings as errors, which is often used to enforce strict coding standards.
112+
- **`/Gm`**: Enables minimal rebuild, allowing faster incremental builds.
113+
- **`/MD`**: Links with the dynamic version of the C runtime library, commonly used for Windows builds.
114+
- **`/Yu"PreRTS.h"`**: Tells the compiler to use precompiled headers, which can speed up compilation time.
115+
116+
---
117+
118+
## When to Use Each Configuration
119+
120+
- **Release:** Use this configuration when preparing the final version of the game for distribution. It ensures the game
121+
is optimized for performance with no debugging overhead.
122+
- **Debug:** Use this configuration during development when you need to debug issues. It disables optimizations and
123+
includes debugging information.
124+
- **Internal:** Use this configuration for internal builds where you need some debugging features but still require
125+
optimized performance.
126+
- **Profile:** Use this configuration when analyzing the performance of the game. It helps identify bottlenecks and
127+
areas that can be optimized further.

SourceCode/Builds/build_guides.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Build Guides
2+
3+
This page provides an overview of the official and community-supported build guides for **TheSuperHackers** project. It
4+
includes both the official build guides for the main repository and guides for community forks of the project. The
5+
guides cover different environments, configurations, and setups for building the project.
6+
7+
## Build Configurations Overview
8+
9+
Before diving into the build guides, it's important to understand the different build configurations used in the
10+
project. These configurations dictate how the project is built, whether for debugging, profiling, release, or internal
11+
development purposes. Some common configurations include:
12+
13+
- **Release:** Optimized for end-users, providing a smaller, faster executable with no debugging information.
14+
- **Debug:** Includes debugging information, making it easier to trace and debug the code, but without optimization to
15+
ensure ease of debugging.
16+
- **Internal:** Includes debugging information and optimizations, used primarily by developers for testing and internal
17+
purposes.
18+
- **Profile:** Used for performance profiling, with optimizations enabled and additional debugging options to collect
19+
profiling data.
20+
21+
Each configuration is designed for a different purpose, whether you're building for development, debugging, testing, or
22+
releasing the final product. You can find more details about the build configurations in
23+
the [Build Configurations](build_configuration) page.
24+
25+
## Architectures and Toolchains
26+
27+
The project supports multiple architectures and toolchains, which is why there are various build guides tailored to
28+
different environments. An **architecture** refers to the target platform, such as **x86** (32-bit) or **x64** (64-bit),
29+
while a **toolchain** is the set of tools (compilers, linkers, etc.) used to build the project. Different toolchains may
30+
support different optimizations, libraries, or debugging features that influence how the build process is conducted.
31+
32+
> [!WARNING]
33+
> The Wiki is under work in progress. The content is subject to change and may not be complete.
34+
> Not all build guides are available yet, but you can contribute by adding new guides or updating existing ones.
35+
36+
## Official Build Guides
37+
38+
These are the official guides provided by **TheSuperHackers** for building the project using various toolchains and
39+
environments.
40+
41+
### **Visual Studio 6 Guides**
42+
43+
1. **Using pure Visual Studio 6 (x86) (Windows)**
44+
- A guide for building the project using only Visual Studio 6 on Windows for the x86 architecture.
45+
[Build with pure Visual Studio 6 (x86) (Windows)](build_with_ea_msvc6)
46+
47+
2. **Using Cmake & Visual Studio 6 (x86) (Windows)**
48+
- A guide for building the project using CMake with Visual Studio 6 on Windows for the x86 architecture.
49+
[Build with CMake & Visual Studio 6 (x86) (Windows)](build_with_msvc6)
50+
51+
#### Sub-guides
52+
53+
- **CLion & VC6 Toolchain**
54+
- A guide for using CLion with the Visual Studio 6 (VC6) toolchain for building the project.
55+
[Build with CLion & VC6 Toolchain](build_with_clion_vc6_toolchain)
56+
- **Docker & VC6**
57+
- A guide for setting up Docker with the Visual Studio 6 (VC6) toolchain for building the project in a
58+
containerized environment.
59+
[Build with Docker & VC6](build_with_msvc6_on_docker)
60+
61+
### **Visual Studio 2022 Guides**
62+
63+
1. **Using Cmake (x86) (Windows)**
64+
- A guide for building the project using CMake with Visual Studio 2022 on Windows for the x86 architecture.
65+
[Build with CMake (x86) (Windows)](build_with_msvc22)
66+
67+
2. **Using Cmake (Linux)**
68+
- A guide for building the project using CMake with Visual Studio 2022 on Linux.
69+
[Build with CMake (Linux)](build_with_msvc22_linux)
70+
71+
## Community Forks Build Guides
72+
73+
These are the guides provided for community-supported forks of **TheSuperHackers** project. These forks are customized
74+
versions of the original repository and may have unique build setups.
75+
76+
1. **MSVC22 (x64) Generals Only (Windows)**
77+
- A guide for building a custom fork of the project using MSVC 2022 (x64) for Windows, specifically tailored for
78+
the "Generals Only" version.
79+
[Build with MSVC22 (x64) Generals Only (Windows)](build_with_msvc22_x64_jmarshall2323)

SourceCode/Builds/build_with_ea_msvc6.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ expansion pack *Zero Hour*. The repository includes the source code and supports
55
games ([C&C Generals](https://steamcommunity.com/workshop/browse/?appid=2229870)
66
and [C&C Generals - Zero Hour](https://steamcommunity.com/workshop/browse/?appid=2732960)).
77

8-
[![WARNING]]: This build guide is based on the original EA build instructions and has not been verified.
8+
[!WARNING]: This build guide is based on the original EA build instructions and has not been verified.
99

1010
## Dependencies
1111

SourceCode/Builds/build_with_msvc6.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,11 @@ Installation of tools and software that are needed for compilation.
5252

5353
## Clone
5454

55-
> **_NOTE:_** The source code you clone is from the WIP from OmniBlade.
56-
5755
Clone the code from TheSuperHackers
5856

5957
`git clone https://github.com/TheSuperHackers/GeneralsGameCode.git`
6058

61-
`cd CnC_Generals_Zero_Hour`
62-
63-
`git switch blade/cmake-build`
59+
`cd GeneralsGameCode`
6460

6561
## Compilation
6662

SourceCode/Home.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ modifying, or extending the game’s core functionality, you're in the right pla
1616
To get started with the project, you will need a basic understanding of the source code and how to build it. If you're
1717
new to the project, here’s how you can contribute:
1818

19-
- Check out the [**Build Guides**](Build_Guides) for instructions on how to compile the game code on
19+
- Check out the [**Build Guides**](build_guides) for instructions on how to compile the game code on
2020
different platforms.
2121
- Learn about the project's **dependencies** and **libraries** in the [Dependencies](Dependencies) section.
2222
- Look through the **community forks** and other variations of the project in the [Forks](Forks) section.
@@ -25,7 +25,7 @@ new to the project, here’s how you can contribute:
2525

2626
## **Quick Links**
2727

28-
- [Build Guides for Different Platforms](Build_Guides)
28+
- [Build Guides for Different Platforms](build_guides)
2929
- [Dependencies and Libraries](Dependencies)
3030
- [Community Forks](forks)
3131
- [Tools for Developers](Tools)

SourceCode/_Sidebar.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
- [Known Issues](known_issues)
1313
- [Contact & Community](contact_community)
1414

15-
## Builds
16-
15+
## [Builds](build_guides)
16+
- [Build Configuration Overview](build_configuration)
1717
### **TheSuperHackers Official Guides**:
1818
- **Visual Studio 6 Guides**:
1919
- [Using pure Visual Studio 6 (x86) (Windows)](build_with_ea_msvc6)

0 commit comments

Comments
 (0)