Skip to content

Build ‐ Windows with Build Tools

Garrett Guillotte edited this page Dec 3, 2025 · 9 revisions

Tested as of 29 Nov 2025 on Windows 11 x86 64-bit with Visual Studio Build Tools 2026 18.0.2

MSVC is not a supported build tool for EmptyEpsilon. To build EmptyEpsilon for Windows, the supported methods are cross-compilation in Build ‐ Windows on Linux or Build ‐ Windows on WSL.

As an alternative to Build ‐ Windows with MSVC, you can also build EmptyEpsilon using Microsoft's Build Tools for Visual Studio. This installs only the compiler and libraries and allows you to build EmptyEpsilon entirely from the Windows command line.

Initial configuration

  1. Download and install Git for Windows (winget install Git.Git or winget install Microsoft.Git).

  2. Download and install Ninja for Windows (winget install Ninja-build.Ninja).

  3. Optional: Download and install Windows Terminal (winget install Microsoft.WindowsTerminal).

  4. Download and install Build Tools for Visual Studio (winget install Microsoft.VisualStudio.BuildTools).

    This installs the Visual Studio Installer.

  5. Open the Visual Studio Installer, click Modify in Visual Studio Build Tools 2026, and check Desktop development with C++.

  6. In the "Installation details" sidebar, make sure that at least these optional items are checked (they should be by default):

    • MSVC Build Tools for x64/x86 (Latest)
    • Windows 11 SDK
    • C++ CMake tools for Windows
  7. Optional: Also check C++ Tools for Linux and Mac Development.

  8. Click Install to download and install the tools.

    This installs several Developer Command Prompt for Visual Studio shortcuts to open a command-line development environment for various architectures and cross-compilation scenarios. If you installed Windows Terminal, this also adds a "Developer PowerShell for VS" profile that automatically includes the necessary development environment.

  9. Clone the EmptyEpsilon and SeriousProton repositories, preferably as siblings under the same parent directory.

  10. Download and unzip the SDL2 VC development libraries.

Set up the build environment

  1. From the command line, go to the EmptyEpsilon repository's directory.

  2. Create and enter a build directory:

    mkdir _build
    cd _build
  3. Run cmake to configure the build:

     cmake .. -G Ninja -DSDL2_DIR="C:/Users/you/source/repos/SDL2-2.32.10/cmake"

    where:

    • C:/Users/you/source/repos/SDL2-2.32.10/ is the path to where you extracted the SDL2 VC development libraries

    Optionally include other build settings as described in Build, such as:

    • -DSERIOUS_PROTON_DIR=../../SeriousProton, where ../../SeriousProton is the path to the SP repository if CMake is unable to locate it
    • -DCMAKE_BUILD_TYPE=RelWithDebInfo for a build you intend to distribute, or -DCMAKE_BUILD_TYPE=Debug for a debug build
  4. Run ninja EmptyEpsilon to build EmptyEpsilon.

    If successful, this produces an EmptyEpsilon.exe executable.

Run the build

To run the build against the repository's scripts and resources, you can copy it and the required SDL2.dll to the EmptyEpsilon repository's root directory and run it from there.

Prerequisite

Copy the SDL2.dll library for your architecture (x86, x64, etc.) from the SDL2 development libraries to the EmptyEpsilon repository root.

For example, the x64 SDL2.dll library is located in SDL2-2.32.10\lib\x64 of the SDL2 2.32.10 VC development libraries ZIP archive. Copy this to the EmptyEpsilon repository root alongside EmptyEpsilon.exe.

Each build

  1. Copy the EmptyEpsilon executable to the repository root.

    For example, from the _build directory, run:

    copy EmptyEpsilon.exe ..
    cd ..
  2. Run EmptyEpsilon.exe from the EmptyEpsilon repository root.

To package EmptyEpsilon into a ZIP file with the required libraries, scripts, and resources, run ninja package from the _build directory.

Troubleshooting

To specify a compiler version or location, use these flags in your cmake command:

-DCMAKE_C_COMPILER="C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\MSVC\14.50.35717\bin\Hostx64\x64\cl.exe" `
-DCMAKE_CXX_COMPILER="C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\MSVC\14.50.35717\bin\Hostx64\x64\cl.exe" `

Compiler strictness issues

Recent versions of MSVC compilers apply stricter rules than C++ compilers on other operating systems, and the build might fail here but work in other environments.

Notable issues include:

  • #ifdef WIN32 can fail to identify the DynamicLibrary header correctly in MSVC. Use #ifdef _WIN32 instead.

  • M_PI is not defined by default in MSVC, which causes compilation to fail where EmptyEpsilon uses it. A manually defined M_PI is defined in vectorUtils.h and can be conditionally included where needed by using #ifdef _WIN32:

    #ifdef _WIN32
    #include "vectorUtils.h"
    #endif
  • The order of definitions and includes is particularly important. The MSVC compiler can fail on circular or ambiguous includes and definitions that other compilers safely ignore.

  • MSVC strictly enforces standards that prohibit ambiguous implicit constructors, and also definitions of static inline class members that use custom types. This breaks SeriousProton's ECS components.

  • MSVC strictly requires explicit template instantiations that other compilers might implicitly handle.

MSVC is not a supported build method, and upstream fixes for issues specific to MSVC might not be accepted, especially if they conflict with other build methods.

Workarounds

You might need to patch EmptyEpsilon based on compilation error messages, or you might need to add additional CMake parameters or environment variables to attempt to override MSVC's settings and reduce strictness, depending on the current state of the EmptyEpsilon and SeriousProton source repos and the restrictions applied to the installed version of the build tools.

Installing older, more lenient versions of the build tools (particularly 2022 or earlier) might also work around these issues. You might also disable some strictness by removing the /permissive- flag from target_compile_options(seriousproton_deps ... in SeriousProton\CMakeLists.txt.

Clone this wiki locally