Skip to content
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

update build guide #7167

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
28 changes: 22 additions & 6 deletions docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,25 +146,33 @@ cmake --build build -j $(sysctl -n hw.ncpuonline)

<details><summary>Windows via MinGW</summary>

This section is about compiling binary executables for Windows on a Linux system host via [MinGW](https://www.mingw-w64.org/). It's not about compiling for Windows on a Windows host via MinGW. So you first need a Linux system host. If you don't, you can also try WSL (Windows Subsystem for Linux) on Windows.

If you have any problems with the build process, please refer to the configuration files in the `.github/workflows` folder. These files are automatically executed by the [GitHub Actions](https://docs.github.com/en/actions) service to automate the build. Under the environment described by these configuration files, the compilation is more likely to succeed.
Comment on lines +149 to +151
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This section is about compiling binary executables for Windows on a Linux system host via [MinGW](https://www.mingw-w64.org/). It's not about compiling for Windows on a Windows host via MinGW. So you first need a Linux system host. If you don't, you can also try WSL (Windows Subsystem for Linux) on Windows.
If you have any problems with the build process, please refer to the configuration files in the `.github/workflows` folder. These files are automatically executed by the [GitHub Actions](https://docs.github.com/en/actions) service to automate the build. Under the environment described by these configuration files, the compilation is more likely to succeed.
This section details how to compile a Windows executable using [MinGW](https://www.mingw-w64.org/) on a Linux system, not on a Windows system. If you are using Windows, you can use WSL (Windows Subsystem for Linux) to accomplish this.


<details><summary>Installing Windows Subsystem for Linux</summary>

If you are building on Windows and do not have WSL already setup this will install WSL and Ubuntu by default (Requires Windows 10 2004 or higher or Windows 11)

In an Administrator Command Prompt or Powershell

```wsl --install```
```pwsh
wsl --install
```

Reboot

Wait for Command Prompt to pop up and say installing when complete enter your new Linux password

You can launch WSL anytime by typing wsl or ubuntu in a Command Prompt or Powershell or in the Start Menu launch the Ubuntu App

For more about WSL, refer to <https://learn.microsoft.com/en-us/windows/wsl/>.

### Setup git and clone DevilutionX

In a WSL terminal run these commands to get the source code for DevilutionX

```
```bash
sudo apt install git
git clone https://github.com/diasurgical/devilutionx
cd devilutionx
Expand All @@ -173,22 +181,30 @@ cd devilutionx

### Installing dependencies on WSL, Debian and Ubuntu

The following compilation process has been tested on `ubuntu-22.04`. Success is not guaranteed on Linux distributions other than Ubuntu 22.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The following compilation process has been tested on `ubuntu-22.04`. Success is not guaranteed on Linux distributions other than Ubuntu 22.
The following compilation process has been tested on `ubuntu-22.04`. Success is not guaranteed on Linux distributions other than Ubuntu 22.04

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ZhiZe-ZG Ubuntu's version are YY.MM, there is one every 6 month, and a long term every 2 years.

23.10 = October 2023
24.04 LTS = April 2024
24.10 = October 2024
...
26.04 LTS = April 2026

So that's why the minor version (month) is important to include and not just the major (year).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks


### 32-bit

Download the 32bit MinGW Development Libraries of [SDL2](https://www.libsdl.org/download-2.0.php) and [Libsodium](https://github.com/jedisct1/libsodium/releases) as well as headers for [zlib](https://zlib.net/zlib-1.2.12.tar.gz) and place them in `/usr/i686-w64-mingw32`. This can be done automatically by running `Packaging/windows/mingw-prep.sh`.
Download the necessary tools and libraries.

```
```bash
# Only tested on Ubuntu 22. This won't work on Ubuntu 24 (they are renamed in Ubuntu 24).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Only tested on Ubuntu 22. This won't work on Ubuntu 24 (they are renamed in Ubuntu 24).
# Only tested on Ubuntu 22.04

This is still the command for these on 24.04

sudo apt-get install cmake gcc-mingw-w64-i686 g++-mingw-w64-i686 pkg-config-mingw-w64-i686 libz-mingw-w64-dev
```

Download the 32bit MinGW Development Libraries of [SDL2](https://www.libsdl.org/download-2.0.php) and [Libsodium](https://github.com/jedisct1/libsodium/releases) as well as headers for [zlib](https://zlib.net/zlib-1.2.12.tar.gz) and place them in `/usr/i686-w64-mingw32`. This can be done automatically by running `Packaging/windows/mingw-prep.sh`.

### 64-bit

Download the 64bit MinGW Development Libraries of [SDL2](https://www.libsdl.org/download-2.0.php) and [Libsodium](https://github.com/jedisct1/libsodium/releases) as well as headers for [zlib](https://zlib.net/zlib-1.2.12.tar.gz) and place them in `/usr/x86_64-w64-mingw32`. This can be done automatically by running `Packaging/windows/mingw-prep64.sh`.
Download the necessary tools and libraries.

```
```bash
# Only tested on Ubuntu 22. This won't work on Ubuntu 24 (they are renamed in Ubuntu 24).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Only tested on Ubuntu 22. This won't work on Ubuntu 24 (they are renamed in Ubuntu 24).
# Only tested on Ubuntu 22.04

This is still the command for these on 24.04

sudo apt-get install cmake gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 pkg-config-mingw-w64-x86-64 libz-mingw-w64-dev
```

Download the 64bit MinGW Development Libraries of [SDL2](https://www.libsdl.org/download-2.0.php) and [Libsodium](https://github.com/jedisct1/libsodium/releases) as well as headers for [zlib](https://zlib.net/zlib-1.2.12.tar.gz) and place them in `/usr/x86_64-w64-mingw32`. This can be done automatically by running `Packaging/windows/mingw-prep64.sh`.

### Compiling

### 32-bit
Expand Down