NanoBoyAdvance can be compiled on Windows, Linux and macOS.
- Clang or G++ with C++17 support
- CMake 3.2 or higher
- OpenGL (usually provided by the operating system)
- SDL2 library
- GLEW library
Clone the Git repository and checkout the submodules:
git clone https://github.com/fleroviux/NanoBoyAdvance.git
git submodule update --initThe 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:
pacman -S cmake sdl2 glewapt install cmake libsdl2-dev libglew-devGet Brew and run:
brew install cmake sdl2 glewYou may need to manually expose GLEW header:
export CPPFLAGS="$CPPFLAGS -I/usr/local/opt/glew/include"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.
Just run make:
make
or to use multiple processor cores:
make -jNUMBER_OF_CORES
Binaries will be output to build/bin/
This guide uses MSYS2 to install Mingw-w64 and other 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-glewcd 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.
Just run make:
make
or to use multiple processor cores:
make -jNUMBER_OF_CORES
Binaries will be output to build/bin/
WARNING: Building with Visual Studio is not tested frequently. You might encounter issues.
This guide uses Visual Studio 2017 (or newer) and VCPKG.
For older Visual Studio versions (before Visual Studio 2019 16.1 Preview 2) you will have to install Clang.
vcpkg install sdl2
vcpkg install glewvcpkg install sdl2:x64-windows
vcpkg install glew:x64-windowsGenerate the Visual Studio solution with CMake.
cd path/to/NanoBoyAdvance
mkdir build
cd build
set VCPKG_ROOT=path/to/vcpkg
cmake -T clangcl ..
Build the generated Visual Studio solution. It can also be done via the command line.
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
msbuild NanoboyAdvance.sln