Changes in Building Widelands in Visual Studio
Editor Comment
Refer to CI if dependencies are broken
Revision Differences of Revision 8
This article explains how to use Microsoft Visual Studio to build and develop Widelands on Windows ¶¶
## Prerequisites ¶
¶
- Install [python](https://www.python.org) ¶
- Install [Visual Studio](https://visualstudio.microsoft.com) together with the English language pack (required for vcpkg). ¶
- Download and install [vcpkg](https://github.com/microsoft/vcpkg) ¶
+ Run `bootstrap-vcpkg.bat -disableMetrics` first. ¶
+ Then run `vcpkg integrate install` to integrate vcpkg with Visual Studio. ¶
+ Install all dependencies (Note the selected static triplet): ¶
`vcpkg install --triplet=x64-windows-static asio gettext[tools] libpng icu glbinding sdl2 sdl2-ttf sdl2-mixer[
+ If you want to save space, you can safely delete the `buildtrees` folder. ¶
- Download the latest static release zip of [gettext](https://github.com/mlocati/gettext-iconv-windows/releases). ¶
+ Extract the contained `bin` folder to `[vcpkg]/installed/x64-windows-static/bin` ¶
¶
## Project configuration ¶
¶
- Copy `utils/win
- Launch Visual Studio and select the Widelands root as workspace. ¶
+ CMake should automatically start parsing the project and picking up the vcpkg toolchain file. ¶
+ Then start compilation ¶
- Copy `utils/win
¶
## Troubleshooting ¶
¶
- vcpkg fails to build a package ¶
+ mpg123: `vcpkg --triplet=x64-windows-static install yasm-tool:x86-windows` ¶
+ remove the package (or its dependency parent) from the install list and install it separately afterwards. vcpkg sometimes has problems resolving dependency chains. ¶
- Take a look at our CI build: ¶
+ Dependency list: [utils/windows/vcpkg_deps](https://github.com/widelands/widelands/blob/master/utils/windows/vcpkg_deps) ¶
+ Commands: [build_windows_msvc.yaml](https://github.com/widelands/widelands/blob/master/.github/workflows/build_windows_msvc.yaml)