Document build instructions.

Fixes #60, #379
This commit is contained in:
Tim Allen
2026-03-19 18:47:05 +11:00
committed by Screwtapello
parent b7304334e6
commit 91cc8b8ef4
3 changed files with 183 additions and 1 deletions
+95
View File
@@ -0,0 +1,95 @@
Build From Source
=================
For details on how official builds are made,
see the [GitHub Actions configuration][CI].
If the official builds work for you,
you should use them.
If they don't work for you,
or you want to modify bsnes,
you'll need to build it yourself.
[CI]: https://github.com/bsnes-emu/bsnes/blob/master/.github/workflows/build.yml
Requirements
------------
On a Debian-Linux like system,
you'll need the following packages installed for a default build:
- `build-essential`
- `libsdl2-dev`
- `libgtk-3-dev`
- `gtksourceview-3.0`
- `libao-dev`
- `libopenal-dev`
On FreeBSD,
you'll need these packages:
- `gmake`
- `gdb`
- `gcc14`
- `pkgconf`
- `sdl2`
- `openal-soft`
- `gtk3`
- `gtksourceview3`
- `libXv`
- `zip`
On Windows,
you should install [MSYS2][],
and from there install `mingw-w64-gcc`
On macOS,
installing the Xcode command-line tools should be enough.
[MSYS2]: https://www.msys2.org/
Building
--------
Once the requirements are installed,
you should be able to build bsnes by opening a terminal
(On Windows, it should be a MinGW-W64 terminal),
changing to the directory where the source code is checked out,
and running:
make -C bsnes
Additional configuration options can be provided,
see [Build Configuration](../reference/build-config.md) for details.
This produces an executable in the `bsnes/out/` directory.
Running
-------
On macOS,
the resulting executable has everything it needs built-in,
so you can just run it directly.
On Windows and Linux,
bsnes needs additional resources like the game database,
shaders, and firmware files.
On Linux or FreeBSD,
you probably also want icons and a `.desktop` file.
To copy all these files into the right places in your home directory,
run:
make -C bsnes install
**Note:** On Linux or FreeBSD, do *not* run `make install` as root.
It sets up the files bsnes needs in *your* home directory,
and you don't want to wind up with a bunch of root-owned files.
bsnes does not support being installed system-wide.
On Linux or FreeBSD,
these auxilliary files are installed to `~/.local/`
while on Windows they're installed to `%%LOCALAPPDATA%%`.
It is possible to make a "portable" distribution
that does not require installation,
by putting the required files beside the executable
just as the official downloads do.
+85
View File
@@ -0,0 +1,85 @@
Build Configuration
===================
bsnes' build system supports many different configuration options,
allowing you to customise the build to your needs.
These options are generally provided on the command-line
when building the software.
For example,
to use the `build=debug` option to make a debug build,
put it on the command-line when building, like this:
make -C bsnes build=debug
**Note:** The build system does not do a good job of detecting
when configuration options have changed,
so before you build with a new configuration option,
do a `make clean` first.
Build targets
-------------
- `target=bsnes` `binary=application`
builds the standalone bsnes application
- `target=libretro` `binary=library`
builds the Libretro core
Build variations
----------------
- `build=debug` makes a build with optimization disabled (`-Og`),
debug symbols,
and additional debug checks
- `build=stable` makes a build with little optimization (`-O1`)
- `build=size` makes the smallest executable it can (`-Os`)
- `build=release` makes a build with sensible optimizations (`-O2`)
- `build=performance` (**default**)
makes a build with all the optimizations (`-O3`)
- `lto=true` makes a build with link-time-optimization enabled
for maximum performance
- `lto=false` (**default**) makes a build with
link-time-optimization disabled
for quick compile times
- `openmp=true` (**default**, but not available on macOS)
enables OpenMP for easy parellelism of things like HD Mode 7
- `openmp=false` disables OpenMP
- `local=true` (**default** for `target=bsnes`)
makes a build optimized for the specific CPU in your machine;
running such a build on other computers
might cause "illegal instruction" errors
- `local=false` makes a build that is likely to run
on any computer compatible with the one in your machine
Toolchain settings
------------------
- `compiler` should be set to a command that runs a C++ compiler
(like `g++` or `clang++`),
used for linking and as the default for the following options,
default varies per platform
- `compiler.c` should be set to a command that runs a C compiler,
defaults to `compiler` plus flags to set the language to C
- `compiler.cpp` should be set to a command that runs a C++ compiler,
defaults to `compiler` plus flags to set the language to C++
- `compiler.objc` should be set to a command that runs
an Objective C compiler,
defaults to `compiler` plus flags to set the language to Objective C
- `compiler.objcpp` should be set to a command that runs
an Objective C++ compiler,
defaults to `compiler` plus flags to set the language to Objective C++
User Interface settings
-----------------------
- `hiro=cocoa` (default on macOS, only on macOS)
Build the macOS native user interface
- `hiro=gtk3` (default on Linux and FreeBSD, also available on Windows)
Build the user interface to use the GTK 3 library
- `hiro=qt5` (available on Linux and FreeBSD)
Build the user interface to use the Qt 5 library;
requires Qt development packages installed
- `hiro=qt6` (available on Linux and FreeBSD)
Build the user interface to use the Qt 6 library;
requires Qt development packages installed
- `hiro=windows` (default on Windows, only on Windows)
Build the Windows native user interface
+3 -1
View File
@@ -11,6 +11,8 @@ nav:
- Introduction: README.md
#- Tutorial:
- How-To Guides:
- Build from source: how-to/build-from-source.md
- Override a memory map: how-to/manifest.md
#- Concepts:
#- Reference:
- Reference:
- Build configuration: reference/build-config.md