Install
You build gameboy from its source code. The build produces two programs: gameboy (the window) and gb_run_rom (the headless runner used for tests).
Good to know
The repository's build pipeline can attach prebuilt archives and Linux packages to a release, but no release has been published. Check the releases page; if it is empty, build from source as described here.
What you need
- CMake 3.16 or newer
- A C++20 compiler (GCC, Clang or MSVC)
- The SDL2 development files
- Git, to download the source
Build on Linux
Install the tools. On Debian or Ubuntu:
bashsudo apt install build-essential cmake git libsdl2-devOn other distributions, install the equivalent compiler, CMake and SDL2 development packages.
Download the source:
bashgit clone https://github.com/Dhiva-Labs/gameboy.git cd gameboyConfigure and build:
bashcmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build -jCheck the result. Run the program with no arguments:
bash./build/gameboyIt prints its usage text, including the key list, and exits. That means the build worked.
The programs are build/gameboy and build/gb_run_rom. You can run them from there; nothing needs to be installed system-wide.
Build on Windows
Use MSVC (Visual Studio 2022) and install SDL2 with vcpkg. Run these in a Developer Command Prompt:
vcpkg install sdl2:x64-windows
cmake -S . -B build -A x64 ^
-DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake ^
-DVCPKG_TARGET_TRIPLET=x64-windows
cmake --build build --config ReleaseFor Windows on ARM64, use sdl2:arm64-windows, -A ARM64 and -DVCPKG_TARGET_TRIPLET=arm64-windows.
The programs and SDL2.dll end up in build\Release\.