Skip to content

Build Instructions for Windows

jcm edited this page Jan 2, 2025 · 12 revisions

ares on Windows can be built either via the default Windows command prompt, or within an MSYS2/MinGW environment.

Table of Contents

Windows Command Prompt (MSVC/Clang-CL)

Prerequisites

  • Windows 10 or higher
  • CMake 3.28 or higher
  • Git for Windows
  • Visual Studio 17 2022
    • Ensure that the "Desktop Development with C++" package is included in your Visual Studio 2022 installation. Building ares with clang also requires that the "C++ Clang tools for Windows" package is installed.

Configuration

First, clone the ares repository:

git clone https://github.com/ares-emulator/ares
cd ares

A Visual Studio project can be setup by using the windows CMake preset:

cmake --preset windows

This preset will generate a Visual Studio project for ares using Clang-CL in the build_vsclang directory that can build all targets and package dependencies appropriately.

If you prefer to use the MSVC compiler, specify the windows-msvc preset:

cmake --preset windows-msvc

The resultant Visual Studio project will be in the build_msvc directory.

Visual Studio presets will generate single-architecture configuration with the host architecture will be created; if you would like to compile for a specific architecture, you may specify -A x64 or -A arm64 as appropriate. Multi-architecture configuration is not supported. 32-bit x86 builds have not been tested and are considered unsupported.

If you wish to build ares from the command line rather than within Visual Studio, you may do so:

cd <build_msvc|build_vsclang>
cmake --build .

MSYS2/MinGW

Under MSYS2, the Visual Studio CMake presets above are still supported. Within MSYS2, ares can also be built in MSYS2 to target libc++ and use GNU Clang:

1. Install dependencies

  • First, install MSYS2. Click below for the directions for your CPU architecture.
x64
  • After installing MSYS2, launch the clang64 environment from the root msys64 folder in your C:/ drive.

    Next, install a toolchain to build with clang:

    pacman -S mingw-w64-clang-x86_64-toolchain
    

    Now, install required dependencies:

    pacman -S git mingw-w64-clang-x86_64-cmake curl
    

    To build ares, Ninja is the recommended build tool:

    pacman -S ninja
    

    If you prefer to use MinGW Makefiles, run pacman -S make instead.

ARM64
  • After installing MSYS2, launch the clangarm64 environment from the root msys64 folder in your C:/ drive.

    Next, install clang:

    pacman -S mingw-w64-clang-aarch64-toolchain
    

    Now, install required dependencies:

    pacman -S git mingw-w64-clang-aarch64-cmake curl
    

    To build ares, Ninja is the recommended build tool:

    pacman -S mingw-w64-clang-aarch64-ninja 
    

    If you prefer to use MinGW Makefiles, run pacman -S make instead.

2. Get the source code

First, clone the ares repository:

git clone https://github.com/ares-emulator/ares
cd ares

3. Build ares

Then, invoke CMake as normal with your chosen generator, e.g Ninja:

mkdir build && cd build
cmake .. -G Ninja

For further configuration options, see the Build Options page.

After configuration, build ares:

cmake --build .

After building ares, the artifacts will be located in the build/desktop-ui/rundir folder. ares.exe may be run from here, or the rundir may be relocated wherever you wish to install. You may optionally run CMake install to install ares:

cmake --install . --prefix </your/install/location>