Files
st/INSTALL.md
T
Yanis bc04021bc0 Add support for clangd in the python tools (#120)
* initial clangd support through python

* update install instructions

* invert configure.py behavior

* fix oopsie

* fix few issues from clangd

* fix related build issues
2026-07-21 19:37:21 +02:00

3.2 KiB

Install

Contents:

Prerequisites

  1. Use one of these platforms:
    • Windows (recommended)
    • Linux
  2. Install the following:
    • Python 3.11+ and pip
    • GCC 9+
    • Ninja
  3. Install the Python dependencies:
python -m pip install -r tools/requirements.txt
  1. Install pre-commit hooks:
pre-commit install
  1. Run the Ninja configure script:
python tools/configure.py

By default this will configure for any version that has a baserom in the extract folder (see below), to configure for one specific version:

python tools/configure.py [--version | -v] <eur|jp>
  1. Put one or more base ROMs in the /extract/ directory of this repository.

Now you can run ninja to build a ROM for the chosen version.

Note

For Linux users: Wibo is used by default. If you want to use Wine instead, run configure.py with -w <path/to/wine>.

Matching the base ROM

This is optional! You only need to follow these steps if you want a matching ROM.

First, extract the ARM7 BIOS from your DS device. Put the ARM7 BIOS in the root directory of this repository, and verify that your dumped BIOS matches one of the following:

File name SHA1
arm7_bios.bin 6ee830c7f552c5bf194c20a2c13d5bb44bdb5c03
arm7_bios.bin 24f67bdea115a2c847c8813a262502ee1607b7df

LSP setup

By default configure.py will create the config file for clangd (at the root folder of the project), if you want to use the alternative setup you can run configure.py with --noclangd | -c to disable the creation of the file.

If you wish to use CMake:

This is likely not necessary. Most C++ editors usually have their one LSP (Language Server Protocol, a tool for code completion and more) configuration that should recognize the project structure and work out of the box. This section is about how to setup your LSP yourself if the need be.

The repository contains a CMakeLists.txt that allows generating a compilation database. For now, the CMakeLists.txt can only be used to generate compile_commands.json and similar files, not compiling the project.
To generate the compilation database, run cmake -S . -G "Unix Makefiles" -B cmake from the root directory of the project. This will create a cmake/ directory that contains the compile_commands.json.
Once the file is generated, you can dynamically link it to the root directory and let your LSP detect it (make sure not to git add it though), or edit your .clangd as follows for it to recognize the compilation database:

CompileFlags:
    CompilationDatabase: "cmake"

This setup is adapted from a tutorial by Strus, refer to his post for further details.