Skip to content

Build Instructions for Windows

jcm edited this page Dec 23, 2024 · 8 revisions

Note

This page applies to the in-development new build system. For current build instructions, see here.

ares on Windows can be built either within an MSYS2/MinGW environment, or via the default Windows command prompt. If performance is a priority, it is generally recommended to use MSYS2/MinGW. If you want to generate a Visual Studio solution for ares, you may use the Windows command prompt (as well as MSYS2).

Table of Contents

MSYS2/MinGW

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 msys2 folder in your C:/ drive.

    Next, install clang:

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

    Now, install required dependencies:

    pacman -S git 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 msys2 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>

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 that will build all targets and package dependencies appropriately.

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

cmake --preset windows-msvc

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 are not currently supported (note 10/14: WIP, may work, just untested).

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 .