diff options
| author | Léo Lam <leo@leolam.fr> | 2021-07-22 02:00:20 +0200 |
|---|---|---|
| committer | Léo Lam <leo@leolam.fr> | 2021-07-22 02:45:01 +0200 |
| commit | 5d7fa0aede10c21f0b0b3d98f62e101a4da43f43 (patch) | |
| tree | 4018d11dda8786a273f28a579f41709597a3716d /README.md | |
| parent | 8cf3dd776bf5a839f9941059ccb7b28e27c6791f (diff) | |
Simplify build setup by adding a setup script
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 52 |
1 files changed, 37 insertions, 15 deletions
@@ -122,32 +122,54 @@ Just like other game decompilations, this project is probably in a legal gray zo ### Alright, how do I start contributing? -First, set up the build environment by following the instructions below. Then follow the [contributing guidelines here](Contributing.md). +First, set up the build environment by following the instructions below. ## Building -### Dependencies +Reminder: **this will not produce a playable game.** This project will not allow you to play the game if you don't already own it on a Switch. + +### For Windows users + +While Linux is not a hard requirement, it is strongly advised to [set up WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to simplify the setup process. Ubuntu 20.04 is usually a good choice. -* Clang 4.0.1 - * Download [Clang 4.0.1](https://releases.llvm.org/download.html#4.0.1) and extract the archive to a convenient location of your choice. - * You might also need libtinfo5. For Ubuntu or Debian users, install it with `sudo apt install libtinfo5` +The instructions below assume that you are using Linux (native or WSL) or macOS. + +### 1. Set up dependencies + +* Python 3.6 or newer * Ninja - * For Ubuntu or Debian users, install it with `sudo apt install ninja-build` * CMake 3.13+ - * If you are on Ubuntu 18.04, you must [update CMake by using the official CMake APT repository](https://apt.kitware.com/). + * If you are on Ubuntu 18.04, you must first [update CMake by using the official CMake APT repository](https://apt.kitware.com/). +* [Optional] ccache (to speed up builds) -Using Linux (or WSL) is recommended but not required. The rest of this guide assumes that you are using a Linux environment, though. +Ubuntu users can install those dependencies by running: -### Building for Switch +```shell +sudo apt install python3 ninja-build cmake ccache +``` -1. After cloning this repository, run: `git submodule update --init --recursive` -2. Run: `env UKING_CLANG=$$$$$ cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=toolchain/ToolchainNX64.cmake -B build` - * Replace `$$$$$` with the path to the extracted Clang archive, such that `$1/bin/clang` exists. This should be an absolute path; use `/home/<name>` instead of `~`. -3. Start the build by running: `ninja -C build` +### 2. Set up the repository -On subsequent builds, just run `ninja -C build` from the project root. +1. Clone this repository. +2. Run `git submodule update --init --recursive` +3. Run `tools/setup.py` + * This will set up [Clang 4.0.1](https://releases.llvm.org/download.html#4.0.1) and create a build directory in `build/`. -Reminder: **this will not produce a playable game.** This project will not allow you to play the game if you don't already own it on a Switch. +### 3. Build + +To start the build, just run + +```shell +ninja -C build +``` + +By default, Ninja will perform a multithreaded build. There is no need to pass -j manually. + +To check whether everything built correctly, just run `tools/check.py` after the build completes. + +## Contributing + +Follow the [contributing guidelines here](Contributing.md). ## Resources |
