Getting Started¶
Note
This guide assists in setting up the development environment for our projects.
For an overview, click here.
Setting up the C/C++ Compiler¶
macOS¶
- Install Xcode from the Mac App Store. This includes the Xcode IDE, Git, and necessary compilers.
- Open Terminal and install the necessary command line tools with:
xcode-select --install
- Install Homebrew, a package manager for macOS, with the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Use Homebrew to install additional tools:
brew install cmake ninja llvm
- Verify the installation of each tool by running
cmake --version
,ninja --version
, andllvm-config --version
.
Windows¶
- Open Command Prompt.
- Install Chocolatey by following the instructions at Chocolatey Installation.
-
Install the compiler and build tools:
choco install -y cmake --installargs '"ADD_CMAKE_TO_PATH=System"' choco install -y ninja choco install -y llvm refreshenv
To install
cmake
for the current user only, replaceSystem
withUser
. -
Verify the installation:
- For
cmake
,ninja
, andclang
, run:cmake --version ninja --version clang --version
- If any command returns an error, check the
PATH
environment variable.
- For
Linux¶
Install cmake
, ninja
, clang
, and other development dependencies using your distribution's package manager. For Ubuntu:
sudo apt install build-essential cmake ninja-build clang xorg-dev libdbus-1-dev libssl-dev mesa-utils
Rust¶
Install Rust from Rust Installation.
Common Instructions for Windows, Linux, and macOS¶
- Verify the Rust installation with
cargo --version
. - Install the nightly version of Rust if required by your project:
Replace
rustup toolchain install nightly rustup +nightly target add <target-architecture>
<target-architecture>
with your system's architecture (e.g.,x86_64-pc-windows-msvc
for Windows,x86_64-unknown-linux-gnu
for Linux). - For web browser support, run:
rustup +nightly target add wasm32-unknown-unknown
- Regularly update Rust using
rustup update
.
Using a specific nightly version if needed¶
Before building the project, ensure that you are using the correct version of the Rust toolchain as specified in the project's rust.version
file. This file is located in the root directory of the project if a specific version is required.
- Navigate to the project's root directory.
- Install the specific Rust toolchain version required by the project:
cat rust.version | xargs rustup toolchain install
- Set the installed toolchain as the default for the current project:
cat rust.version | xargs rustup override set
Now, proceed with the project-specific build instructions.
Git & GitHub¶
Git is a distributed version control system essential for managing project codebases.
macOS¶
If not already installed with Xcode, install Git using Homebrew:
brew install git
Windows¶
Use Chocolatey for installation:
choco install -y git
Linux¶
Install Git using:
sudo apt install git
Code Editor¶
We recommend Visual Studio Code (VS Code) for this tutorial.
Download and install VS Code from VS Code Download
VS Code Extensions¶
Install the following extensions to enhance your development experience:
- C/C++
- rust-analyzer
- CodeLLDB
- Better TOML
- CMake Tools
- YAML
- Fragcolor Shards - Direct link to the Fragcolor Shards extension on the VS Code Marketplace.
Overview¶
Here is a quick overview of the setup process for Windows and Linux. Refer to the respective sections above for detailed instructions.
macOS¶
- Install Xcode and command line tools.
- Install Homebrew.
- Install
cmake
,ninja
, andllvm
using Homebrew. - Install Rust and set up the nightly build.
- Install the Rust Web Assembly toolchain.
- Regularly update Rust.
- Install Git using Homebrew.
- Install VS Code and the recommended extensions.
Windows¶
- Install Chocolatey.
- Install
cmake
,ninja
, andllvm
with Chocolatey. - Install Rust and set up the nightly build.
- Install the Rust Web Assembly toolchain.
- Regularly update Rust.
- Install Git and a Git GUI Client.
- Install VS Code and the recommended extensions.
Linux¶
- Install development dependencies including
cmake
,ninja
, andclang
. - Install Rust and set up the nightly build.
- Install the Rust Web Assembly toolchain.
- Regularly update Rust.
- Install Git.
- Install VS Code and the recommended extensions.