# Building

## Windows (10+)
1. Download [Visual Studio Build Tools 2022](https://aka.ms/vs/17/release/vs_buildtools.exe).
2. Install **C++ Buildtools**.
3. Open *Search > Developer PowerShell for VS 2022*.
4. Using the terminal, move to the project directory.
5. `cmake -B build32 -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release -A Win32` (x86) or `cmake -B build64 -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release -A x64` (x86_64)
6. `cmake --build build32` or `cmake --build build64`

## Linux (msvc-wine)
1. Install `cmake` and `ninja` using your package manager.
2. Download Visual Studio Build Tools using [msvc-wine](https://github.com/mstorsjo/msvc-wine/). Refer to its README for instructions. We’ll assume it was installed to `/opt/msvc`.
3. `git clone https://git.darkness9724.eu.org/Darkness9724/toolchain.git` or write your own MSVC toolchain file if you installed MSVC to a different location.
4. `cmake -B build32 -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=toolchain/msvc-wine/toolchain-x86.cmake` (x86) or `cmake -B build64 -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/opt/msvc/cmake/toolchain-x64.cmake` (x86_64)
5. `cmake --build build32` or `cmake --build build64`

## AUR
1. `paru -S cmake ninja msvc-wine-git`
2. `cmake -B build32 -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/opt/msvc/cmake/toolchain-x86.cmake` (x86) or `cmake -B build64 -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/opt/msvc/cmake/toolchain-x64.cmake` (x86_64)
3. `cmake --build build32` or `cmake --build build64`
