Skip to content

Building on Windows

Pi-tracy edited this page Nov 16, 2023 · 9 revisions

higan is only compatible with the GCC and Clang compilers, not with Visual Studio. The easiest and most reliable way to get a compatible toolchain is using the MSYS2 environment.

Setup

  1. Go to https://www.msys2.org/ and download the installer

    • There's an "Installation" heading on the front page with a link to msys2-x86_64-whatever.exe which is the thing you want
  2. When the download is complete, run the installer

  3. Hit "Next" all the way through, the defaults are fine

  4. At the end, you'll be given the option to "Run MSYS2 64bit now" — do it

  5. When the MSYS2 terminal appears, update all the installed packages to the latest versions:

    pacman -Syu
    
  6. Close the MSYS2 MSYS window, run it again from the Start menu, and run the update command again

    • Repeat until there's no updates left to install
  7. Install the GCC toolchain compatible with Windows:

    pacman -S mingw-w64-x86_64-toolchain
    
  8. (Optional) If you want to keep up-to-date with development, or even contribute, you'll want to install the Git version control system too:

    pacman -S git
    

Building

  1. From the Start menu, open the "MSYS2 MinGW 64-bit" terminal (not the "MSYS2 MSYS" terminal used for installing/updating packages)

  2. Change to the directory where you've put the higan source code

    • Hint: You can type cd in the terminal, then hit space, then drag and drop the folder containing the higan source code onto the terminal (which types in the correct path), then hit Enter in the terminal to change to that directory
  3. Build the executables:

    mingw32-make -C icarus
    mingw32-make -C higan-ui
    
  4. Package everything ready to be used:

    # Delete previous build results
    rm -rf build 
    # A fresh directory for a fresh build
    mkdir -p build
    # Stage everything into the build directory
    mkdir -p build/Systems
    cp -ar higan-ui/out/* build/
    cp -ar icarus/out/* build/
    cp -a higan/System build/Templates
    cp -a icarus/Database build/
    cp -a icarus/Firmware build/
    cp -ar extras/* build/
    
  5. Run build\higan-ui.exe to try it out.

Clone this wiki locally