What you need to build
What you need depends on what you’re building for. A web build needs nothing at all. A phone build needs Apple’s or Google’s tool to finish the app in. A build for computers needs Rust, and a few more tools when it’s for a different kind of computer than yours. The build installs most of those itself.
| Building for | You install | The build installs, the first time |
|---|---|---|
| Web | nothing | nothing |
| iOS and tvOS | Xcode, on a Mac | nothing |
| Android | Android Studio | nothing |
| Your own kind of computer | Rust | Rust’s parts for that computer |
| Windows, from a Mac or Linux | Rust | cargo-xwin, which fetches the Windows SDK; LLVM, if you say yes |
| macOS or Linux, from another kind of computer | Rust | cargo-zigbuild and zig |
Every build also fetches a player for each platform and the app templates the first time, so the first build needs the internet. After that they’re kept, and later builds take seconds.
Phones and the web
A web build is made from what the IDE already has: there’s nothing to install.
The phone builds make projects, and the engine in them is ready-made, so there’s nothing for the IDE to compile. Finishing them is done in:
- Xcode, free from the Mac App Store, for iPhone, iPad and Apple TV. It only runs on a Mac.
- Android Studio, free from Google, for Android. It brings everything else Android needs (its own Java, and the Android SDK) and asks to install it the first time it opens.
Games for phones and Apple TV goes through both.
Rust
Each Windows, macOS and Linux build compiles a small player just for your
game, and compiling needs Rust. Install it from
rustup.rs. It’s free, and it puts rustup and cargo
in your home folder, which is where the build looks for them. Until Rust is
there, the Build window says so in red and won’t build for computers.
Rust needs a linker from your computer’s own tools, the same one any program for that computer is made with:
- On a Mac, the Command Line Tools: run
xcode-select --installin Terminal, or install Xcode. - On Windows, Microsoft’s C++ Build Tools. Rust’s installer offers to install them; say yes.
- On Linux, a C compiler:
build-essentialon Ubuntu and Debian,gccon Fedora and Arch.
What the build installs itself
When a build needs something more and you have Rust, it installs it, says what it’s doing in the build’s log, and keeps it for next time:
- Rust’s parts for each platform, with
rustup target add: one for Windows (x86_64-pc-windows-msvc), one for Linux (x86_64-unknown-linux-gnu), and two for a Mac (aarch64-apple-darwinandx86_64-apple-darwin, for the newer Macs and the older ones). They go in with Rust. - cargo-xwin, to build for Windows from a Mac or Linux, with
cargo install cargo-xwin. The first time it’s used, it downloads Microsoft’s Windows SDK and runtime for it, which takes a while. - cargo-zigbuild, to build for Linux from a Mac or Windows, or for a Mac
from Windows or Linux, with
cargo install cargo-zigbuild. It needs zig too, which the build installs with Python’spip, asziglang==0.14.1, or on Windows with Scoop or winget if there’s no Python.
What cargo install makes goes in .cargo/bin in your home folder, beside
cargo itself.
One thing it asks about first: LLVM. A Windows game built on a Mac or
Linux needs LLVM’s llvm-rc to put your icon.png in the .exe. LLVM is
big (hundreds of megabytes), so when a project has an icon and LLVM is
missing, the build asks before installing it with Homebrew, apt, dnf or
pacman. Say no, and the game still
builds, with Windows’ plain icon instead of yours.
Installing them yourself
You may rather install these yourself, to choose the versions, to keep them up to date with the rest of your tools, or because your computer doesn’t let programs install things. The build only installs what it can’t find, so anything you’ve installed first, it uses:
rustup target add x86_64-pc-windows-msvc x86_64-unknown-linux-gnu
rustup target add aarch64-apple-darwin x86_64-apple-darwin
cargo install cargo-xwin
cargo install cargo-zigbuild
pip install ziglang==0.14.1
brew install llvm
Only the lines for the platforms you build for matter. Install LLVM however
your computer installs things (apt, dnf or pacman on Linux); the build
finds Homebrew’s even though Homebrew leaves it off your PATH. Zig can be
installed from ziglang.org too, as long as zig is
on your PATH.
Crash-tan’s Tip: Zig has to be 0.14, not the newest. Newer ones crash when cargo-zigbuild asks them to build. That’s why the build doesn’t install zig with Homebrew, which only has the newest.
To stop the build installing cargo-xwin, cargo-zigbuild and zig, set
CRASHPACKAGER_NO_AUTO_INSTALL before you start the IDE:
export CRASHPACKAGER_NO_AUTO_INSTALL=1
Then, when one of them is missing, the build skips that platform, saying
what to install, and builds the others. It still adds Rust’s parts for a
platform (they’re part of Rust, and rustup does nothing if they’re there
already), and it still asks before installing LLVM.