mirror of
https://github.com/open-goal/jak-project
synced 2026-08-19 06:02:15 -04:00
docs: README pass, add alternative editor documentation (Zed) (#4137)
I'm switching away from visual studio (because its broken) so figured I'd document / commit the minimum to get a working environment with the editor I chose (Zed). Also cleaned up the main README so it's not so verbose, link out to secondary pages, etc. I also deleted the Arch and Fedora dockerfiles, they were broken. The ubuntu one still works, so i left it.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# Docker
|
||||
|
||||
You can use docker to compile the project as well. Note that the Dockerfiles in the project often fall out of maitenance because no one on the main development team uses them, when this is noticed, they are deleted.
|
||||
|
||||
```sh
|
||||
docker build -f docker/Ubuntu-20.04.Dockerfile -t jak .
|
||||
```
|
||||
|
||||
This will create an image with all required dependencies and already built.
|
||||
|
||||
```sh
|
||||
docker run -v "$(pwd)"/build:/home/jak/jak-project/build -it jak bash
|
||||
```
|
||||
|
||||
Note: If you change the content of the `build/` directory you'll need to rerun the `docker build` command. Alternatively you can get the build via `docker cp`.
|
||||
|
||||
This will link your `build/` folder to the images so can validate your build or test it on an external device.
|
||||
|
||||
Docker images can be linked into your IDE (e.g. CLion) to help with codesniffing, static analysis, run tests and continuous build.
|
||||
|
||||
Unfortunately you'll still need task runner on your local machine to run the game or instead, manually run the game via the commands found in `Taskfile.yml`.
|
||||
@@ -0,0 +1,60 @@
|
||||
# Linux Environment Setup
|
||||
|
||||
- [Linux Environment Setup](#linux-environment-setup)
|
||||
- [Packages](#packages)
|
||||
- [Ubuntu (20.04)](#ubuntu-2004)
|
||||
- [Arch](#arch)
|
||||
- [Fedora](#fedora)
|
||||
- [Compiling and Building](#compiling-and-building)
|
||||
|
||||
|
||||
## Packages
|
||||
|
||||
### Ubuntu (20.04)
|
||||
|
||||
```sh
|
||||
sudo apt install gcc make cmake ninja-build build-essential g++ nasm clang-format libxrandr-dev libxinerama-dev libxcursor-dev libpulse-dev libxi-dev python libgl1-mesa-dev libssl-dev
|
||||
sudo sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
|
||||
```
|
||||
|
||||
## Arch
|
||||
|
||||
```sh
|
||||
sudo pacman -S cmake libpulse base-devel nasm python libx11 libxrandr libxinerama libxcursor libxi
|
||||
yay -S go-task
|
||||
```
|
||||
|
||||
> Note: Any later documentation that shows a `task ...` command, would instead be a `go-task ...` command.
|
||||
|
||||
## Fedora
|
||||
|
||||
```sh
|
||||
sudo dnf install cmake python lld clang nasm libX11-devel libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel pulseaudio-libs-devel mesa-libGL-devel
|
||||
sudo sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
|
||||
```
|
||||
|
||||
## Compiling and Building
|
||||
|
||||
Compile:
|
||||
|
||||
```sh
|
||||
cmake -B build && cmake --build build -j 8
|
||||
```
|
||||
|
||||
Run tests:
|
||||
|
||||
```sh
|
||||
./test.sh
|
||||
```
|
||||
|
||||
Note: we have found that `clang` and `lld` are significantly faster to compile and link than `gcc`, generate faster code, and have better warning messages. To install these:
|
||||
|
||||
```sh
|
||||
sudo apt install lld clang
|
||||
```
|
||||
|
||||
and run `cmake` (in a fresh build directory) with:
|
||||
|
||||
```sh
|
||||
cmake -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ..
|
||||
```
|
||||
@@ -0,0 +1,34 @@
|
||||
# MacOS Environment Setup
|
||||
|
||||
Running the game requires an Apple Silicon Mac running macOS Sequoia, or an Intel Mac. Additionally, we currently build on macOS 15 (Sequoia) at this time.
|
||||
|
||||
Ensure that you have Xcode command line tools installed (this installs things like Apple Clang). If you don't, you can run the following command:
|
||||
|
||||
```bash
|
||||
xcode-select --install
|
||||
```
|
||||
|
||||
On Apple Silicon, Rosetta 2 also must be installed:
|
||||
|
||||
```bash
|
||||
softwareupdate --install-rosetta
|
||||
```
|
||||
|
||||
## Building for x86_64
|
||||
|
||||
```bash
|
||||
brew install cmake nasm ninja go-task clang-format
|
||||
cmake -B build --preset=Release-macos-x86_64-clang
|
||||
cmake --build build --parallel $((`sysctl -n hw.logicalcpu`))
|
||||
```
|
||||
|
||||
## Building for ARM64 (experimental, unsupported)
|
||||
|
||||
```bash
|
||||
brew install cmake ninja go-task clang-format
|
||||
cmake -B build --preset=Release-macos-arm64-clang
|
||||
cmake --build build --parallel $((`sysctl -n hw.logicalcpu`))
|
||||
```
|
||||
|
||||
You may have to add the MacOS SDK to your `LIBRARY_PATH`:
|
||||
- `export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"`
|
||||
@@ -0,0 +1,13 @@
|
||||
# Windows Environment Setup
|
||||
|
||||
Even if you do not intend to use Visual Studio as your IDE of choice, it is the only officially supported way of downloading the various Windows SDKs to build the C++ project.
|
||||
|
||||
Download the latest community edition from [here](https://visualstudio.microsoft.com/vs/). At the time of writing this is Visual Studio 2022.
|
||||
|
||||
You will require the `Desktop development with C++` workload. This can be selected during the installation, or after via the `Visual Studio Installer` program and modifying the Visual Studio Installation.
|
||||
|
||||
We recommend getting the rest of the project's dependencies via a package manager, and for that we use Scoop. Follow the steps on the bottom of the homepage [here](https://scoop.sh/) to get it installed.
|
||||
|
||||
```sh
|
||||
scoop install git llvm nasm python task ninja cmake
|
||||
```
|
||||
Reference in New Issue
Block a user