1
Building on Nintendo Switch
Dima353 edited this page 2026-07-19 00:26:02 +03:00

This wiki page shows how to build re3/reVC for the Nintendo Switch. The Switch target is built with CMake and the devkitA64 toolchain (the premake build files are for desktop platforms only). Building has been tested on Linux and on WSL.

You need:

  • devkitPro with the devkitA64 toolchain (switch-dev)
  • the Switch portlibs providing SDL2, GLFW, Mesa (OpenGL), OpenAL and mpg123 — install them with dkp-pacman
  • cmake (3.14 or newer)

librw is vendored in the repository, so it is built for you.

Branches

Both games live in this repository:

  • master - re3 (GTA III)
  • miami - reVC (GTA Vice City)

The steps below use re3. For reVC just check out the miami branch and replace the RE3_ option prefix with REVC_.

Build variants

Every build is made in one of two variants, chosen with the RE3_RT (REVC_RT for Vice City) CMake option:

  • -DRE3_RT=ON (default) - 10thAE, the Revisited Trilogy edition. Reworked HUD, menus, controller artwork and fonts. Packages the resources from gamefiles/10thae/.
  • -DRE3_RT=OFF - vanilla, stock resources and behaviour. Packages the resources from gamefiles/vanilla/.

The option controls both the code (it defines RT for the compiler) and which resource set ends up in the package, so a build is always consistent with its resources.

Steps

  • Clone the project with its submodules:

    $ git clone --recursive https://github.com/Dima353/re3.git
    $ cd re3
    
  • Configure the build. Use a separate build directory per variant, because the variant is cached by CMake:

    $ mkdir build && cd build
    $ cmake .. -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake \
        -DRE3_AUDIO=OAL \
        -DLIBRW_PLATFORM=GL3 \
        -DLIBRW_GL3_GFXLIB=GLFW \
        -DRE3_WITH_OPUS=False \
        -DRE3_VENDORED_LIBRW=True \
        -DRE3_INSTALL=True \
        -DRE3_RT=ON
    

    Instead of passing the toolchain file you may use devkitPro's wrapper, which also presets the portlibs search paths — both are equivalent:

    $ /opt/devkitpro/portlibs/switch/bin/aarch64-none-elf-cmake .. <same -D options>
    
  • Compile:

    $ make -j$(nproc)
    
  • Package the build. cpack collects the .nro together with the resource set that matches the variant you configured:

    $ cpack -G TXZ
    

    This produces re3-oal-switch-10thae.tar.xz (or -vanilla) in the build directory. Use cpack without arguments to get a .zip instead.

  • Extract the archive onto your SD card and run the .nro. The archive already contains the correct TEXT/, data/, models/ and neo/ for the variant, so you do not need to copy any resources by hand — you only need the original game assets that re3 cannot ship.

To build the other variant, repeat the steps in a fresh directory with -DRE3_RT=OFF:

$ mkdir build-vanilla && cd build-vanilla
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake ... -DRE3_RT=OFF

Continuous integration

.github/workflows/build-switch.yml builds both variants on every push and pull request, and uploads them as separate artifacts:

  • switch-gl3-10thae
  • switch-gl3-vanilla

(reVC uses the miami branch and names its artifacts switch-gl3-miami-10thae / switch-gl3-miami-vanilla.)

Notes

  • RE3_INSTALL=True is required — without it the install rules that select the resource set are not generated, and cpack would package the executable only.
  • If you build the .nro by hand instead of using cpack, remember to copy the resources from the matching gamefiles/10thae/ or gamefiles/vanilla/ directory yourself.
  • Debug menu can be opened on a controller with X+R (see Home).