Skip to content

Latest commit

 

History

History
107 lines (79 loc) · 2.07 KB

COMPILING.md

File metadata and controls

107 lines (79 loc) · 2.07 KB

NanoBoyAdvance can be compiled on Windows, Linux and macOS.

Prerequisites

  • Clang or G++ with C++17 support
  • CMake 3.2 or higher
  • OpenGL (usually provided by the operating system)
  • SDL2 library
  • GLEW library
  • Qt5 library

Source Code

Clone the Git repository with submodules:

git clone --recursive https://github.com/nba-emu/NanoBoyAdvance.git

Unix Build (Linux, macOS)

1. Install dependencies

The way that you install the dependencies will vary depending on the distribution you use.
Typically you'll have to invoke the install command of some package manager.
Here is a list of commands for popular distributions and macOS:

Arch Linux
pacman -S cmake sdl2 glew qt5-base
Ubuntu or other Debian derived distribution
apt install cmake libsdl2-dev libglew-dev qtbase5-dev libqt5opengl5-dev
macOS

Get Brew and run:

brew install cmake sdl2 glew qt@5
FreeBSD
su
pkg install cmake git sdl2 glew qt5 qt5-opengl

2. Setup CMake build directory

cd /somewhere/on/your/system/NanoBoyAdvance
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..

NOTE: the location and name of the build directory is arbitrary.

3. Compile

Just run make:

make

or to use multiple processor cores:

make -jNUMBER_OF_CORES

Binaries will be output to build/bin/

Windows Mingw-w64 (GCC)

This guide uses MSYS2 to install Mingw-w64 and other dependencies.

1. Install dependencies

In your MSYS2 command line run:

pacman -S make mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-SDL2 mingw-w64-x86_64-glew mingw-w64-x86_64-qt5-static

2. Setup CMake build directory

cd path/to/NanoBoyAdvance
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..

NOTE: the location and name of the build directory is arbitrary.

3. Compile

Just run make:

make

or to use multiple processor cores:

make -jNUMBER_OF_CORES

Binaries will be output to build/bin/