2022-12-28 21:56:20 +10:00
|
|
|
# Building on Windows
|
|
|
|
|
2021-02-18 17:25:40 +01:00
|
|
|
Windows builds can be created using:
|
|
|
|
|
2023-09-03 18:30:14 +10:00
|
|
|
- MSVC compiler, Visual Studio 2022 IDE suite, and vcpkg to provide dependencies
|
2021-02-18 17:25:40 +01:00
|
|
|
*(recommended)*.
|
|
|
|
- The Clang or GCC compilers using the Meson buildsystem running within the
|
|
|
|
MSYS2 environment to provide dependencies.
|
|
|
|
|
2022-12-14 14:42:44 +10:00
|
|
|
|
2021-02-18 17:25:40 +01:00
|
|
|
## Build using Visual Studio
|
|
|
|
|
2023-09-03 18:30:14 +10:00
|
|
|
1. Install Visual Studio Community 2022: <https://visualstudio.microsoft.com/>.
|
2021-02-18 17:25:40 +01:00
|
|
|
2. Install vcpkg: <https://github.com/Microsoft/vcpkg#quick-start-windows>.
|
|
|
|
3. Follow instructions in [README.md](/README.md).
|
|
|
|
|
2021-04-20 07:21:53 -07:00
|
|
|
### Create a Debugger build using Visual Studio
|
|
|
|
|
|
|
|
Note that the debugger imposes a significant runtime performance penalty.
|
|
|
|
If you're not planning to use the debugger then the steps above will help
|
|
|
|
you build a binary optimized for gaming.
|
|
|
|
|
2022-06-11 14:59:34 +12:00
|
|
|
1. Edit `src\platform\visualc\config.h` and enable `C_DEBUG` and optionally
|
2021-04-20 07:21:53 -07:00
|
|
|
`C_HEAVY_DEBUG` by setting them to `1` instead of `0`.
|
2022-12-14 14:42:44 +10:00
|
|
|
|
2022-06-11 14:59:34 +12:00
|
|
|
2. Select a **Release** build type in Visual Studio, and run the build.
|
2021-04-20 07:21:53 -07:00
|
|
|
|
2022-12-14 14:42:44 +10:00
|
|
|
|
2021-02-18 17:25:40 +01:00
|
|
|
## Build using MSYS2
|
|
|
|
|
2022-01-31 15:05:29 -08:00
|
|
|
1. Install MSYS2: <https://www.msys2.org/wiki/MSYS2-installation/>
|
2021-02-18 17:25:40 +01:00
|
|
|
|
2022-01-31 15:05:29 -08:00
|
|
|
2. Install Git: `pacman -S git`
|
2021-02-18 17:25:40 +01:00
|
|
|
|
|
|
|
3. Clone and enter the repository's directory:
|
|
|
|
|
|
|
|
``` shell
|
2021-10-03 08:58:26 -07:00
|
|
|
git clone https://github.com/dosbox-staging/dosbox-staging.git
|
2021-02-18 17:25:40 +01:00
|
|
|
cd dosbox-staging
|
|
|
|
```
|
2022-01-31 15:05:29 -08:00
|
|
|
|
|
|
|
4. Update the pacman database and packages:
|
2022-12-28 21:56:20 +10:00
|
|
|
|
|
|
|
- Open an MSYS2 console from your start menu.
|
|
|
|
- Run `pacman -Syu`, answer `Y`, and let it run to completion.
|
|
|
|
- Close your terminal when it's done.
|
2023-01-16 01:02:08 -08:00
|
|
|
- Re-open the terminal and repeat the process one last time: Run `pacman -Syu`, answer `Y`, and let it run to completion.
|
2022-01-31 15:05:29 -08:00
|
|
|
|
|
|
|
5. Install the GCC and Clang runtime groups:
|
|
|
|
|
|
|
|
Note: this will uninstall non-MinGW compilers followed by installing
|
|
|
|
the GCC and Clang runtime groups along with Staging's dependencies.
|
|
|
|
|
|
|
|
``` shell
|
2023-01-16 01:02:08 -08:00
|
|
|
cd dosbox-staging
|
2022-01-31 15:05:29 -08:00
|
|
|
pacman -R clang
|
|
|
|
pacman -R gcc
|
|
|
|
pacman -S $(cat packages/windows-msys2-clang-x86_64.txt packages/windows-msys2-gcc-x86_64.txt)
|
|
|
|
```
|
|
|
|
|
|
|
|
Close your terminal when this finishes.
|
|
|
|
|
|
|
|
6. Open a toolchain-specific MinGW terminal:
|
|
|
|
|
2022-12-28 21:56:20 +10:00
|
|
|
- **GCC**: _Start Menu > Programs > MSYS2 > MSYS2 MinGW x64_
|
|
|
|
- **Clang**: _Start Menu > Programs > MSYS2 > MSYS2 MinGW Clang x64_
|
2022-01-31 15:05:29 -08:00
|
|
|
|
|
|
|
You can then use those specific toolchains within the
|
|
|
|
respecitive terminal.
|
|
|
|
|
|
|
|
7. Setup a GCC build from an *MSYS2 MinGW x64* terminal:
|
|
|
|
|
2021-12-18 16:49:39 +13:00
|
|
|
``` shell
|
2022-08-04 14:01:46 -07:00
|
|
|
meson setup build/release-gcc
|
2021-12-18 16:49:39 +13:00
|
|
|
```
|
|
|
|
|
2022-01-31 15:05:29 -08:00
|
|
|
8. Setup a Clang build from an *MSYS2 MinGW Clang x64* terminal:
|
2021-12-18 16:49:39 +13:00
|
|
|
|
|
|
|
``` shell
|
2022-08-04 14:01:46 -07:00
|
|
|
meson setup build/release-clang --native-file=.github/meson/native-clang.ini
|
2021-12-18 16:49:39 +13:00
|
|
|
```
|
2022-01-31 15:05:29 -08:00
|
|
|
|
2023-02-09 19:49:30 +01:00
|
|
|
If building for Vista use instead:
|
|
|
|
|
|
|
|
``` shell
|
|
|
|
meson setup -Duse_fluidsynth=false -Duse_slirp=false build/release-clang --native-file=.github/meson/native-clang.ini
|
|
|
|
```
|
|
|
|
|
2022-01-31 15:05:29 -08:00
|
|
|
9. Compile:
|
|
|
|
|
|
|
|
``` shell
|
|
|
|
meson compile -C build/release-gcc
|
|
|
|
# or
|
|
|
|
meson compile -C build/release-clang
|
|
|
|
```
|
|
|
|
|
|
|
|
10. Create a package of the binary and DLLs to a destination directory:
|
2021-12-18 16:49:39 +13:00
|
|
|
|
|
|
|
``` shell
|
2022-01-31 15:05:29 -08:00
|
|
|
./scripts/create-package.sh -p msys2 build/release-gcc ../dosbox-staging-gcc-pkg
|
|
|
|
# or
|
|
|
|
./scripts/create-package.sh -p msys2 build/release-clang ../dosbox-staging-clang-pkg
|
2021-12-18 16:49:39 +13:00
|
|
|
```
|