Files
Tyler Wilding cbe21e3b4b 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.
2026-03-22 13:17:56 -04:00

61 lines
1.6 KiB
Markdown

# 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++ ..
```