Ninja
🚀️ Always up-to-date Ninja binaries for Linux, Windows, macOS, and FreeBSD - just download and use it.
⭐ If you find this repository useful, please consider giving it a star.
The Linux binaries are compiled with the GCC Toolchain targeting older glibc
versions and musl, ensuring compatibility across a wide range of Linux distributions. The Windows binaries are compiled
with MSVC and statically linked against the MSVC runtime, so the Visual C++ Redistributable is not required to run them.
The macOS binaries are compiled with Clang for Apple Silicon (aarch64), targeting macOS 11.0 (Big Sur) and later. The
FreeBSD binaries are compiled with Clang targeting FreeBSD 13.5 and later. GitHub CI workflows are used to automate the
build process: pipelines run daily, but new builds are triggered only when a new Ninja release is available.
Why?
- Outdated distro packages. Many Linux distributions ship outdated Ninja versions through their package managers,
sometimes years behind upstream.
- Limited official releases. The official Ninja releases only ship a single binary per platform. This repository
builds and publishes Ninja for a much wider range of platforms and architectures, so you don't have to build it
yourself.
- Always up to date. GitHub CI workflows rebuild and publish Ninja automatically whenever a new version is released
upstream.
- No extra dependencies. Windows binaries statically link the MSVC runtime and musl-based Linux binaries are fully
static, so there's no separate runtime to install. The remaining builds only depend on base system libraries that are
already present on the OS.
Build Information
Linux
- GNU targets are dynamically linked with an older glibc version; musl targets are fully statically linked.
For details, see the GCC Toolchain.
- Statically linked with libstdc++ and libgcc.
Windows
- Statically linked with the MSVC runtime (
/MT).
macOS
- Built only for Apple Silicon (aarch64), targeting macOS 11.0 (Big Sur) and later.
FreeBSD
- Built only for x86_64, targeting FreeBSD 13.5 and later.
Precompiled Binaries
If you prefer not to build the Ninja yourself, a precompiled Ninja for each supported architecture can be
downloaded from the releases page.
Linux
Replace <target> with one of: x86_64-linux-gnu, x86_64-linux-musl, aarch64-linux-gnu, aarch64-linux-musl,
arm-linux-gnueabi, arm-linux-musleabi, riscv64-linux-gnu, riscv64-linux-musl.
The command installs Ninja to /usr/local/bin. Replace it with a different path if needed.
curl -sSL https://github.com/prepkg/ninja/releases/latest/download/ninja-<target>.tar.gz | sudo tar xz -C /usr/local/bin
For example:
curl -sSL https://github.com/prepkg/ninja/releases/latest/download/ninja-x86_64-linux-gnu.tar.gz | sudo tar xz -C /usr/local/bin
Windows
The command installs Ninja in the current directory. Replace .\ with a different path if needed.
curl -sSL https://github.com/prepkg/ninja/releases/latest/download/ninja-x86_64-windows-msvc.tar.gz | tar xz -C .\
curl -sSL https://github.com/prepkg/ninja/releases/latest/download/ninja-aarch64-windows-msvc.tar.gz | tar xz -C .\
macOS
The command installs Ninja to /usr/local/bin. Replace it with a different path if needed.
curl -sSL https://github.com/prepkg/ninja/releases/latest/download/ninja-aarch64-macos-clang.tar.gz | sudo tar xz -C /usr/local/bin
FreeBSD
The command installs Ninja to /usr/local/bin. Replace it with a different path if needed.
curl -sSL https://github.com/prepkg/ninja/releases/latest/download/ninja-x86_64-freebsd-clang.tar.gz | sudo tar xz -C /usr/local/bin
Compilation
Linux
Requirements
Instructions
git clone https://github.com/prepkg/ninja.git && cd ninja
./setup.sh build-image
./setup.sh build-app
After compilation, the tar.gz for each architecture will be available in the build directory.
Windows
Requirements
- Visual Studio with the "Desktop development with C++" workload
- Git
- CMake
- Ninja
- re2c
Instructions
git clone https://github.com/prepkg/ninja.git && cd ninja
- Build the application, passing the path to the Visual Studio
VC\Auxiliary\Build directory:
powershell -ExecutionPolicy Bypass -File .\scripts\windows\compile.ps1 "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build"
After compilation, the tar.gz for each architecture will be available in the build directory.
macOS
Requirements
- Xcode Command Line Tools
- Git
- CMake
- Ninja
- re2c
Instructions
git clone https://github.com/prepkg/ninja.git && cd ninja
./scripts/macos/compile.sh
After compilation, the tar.gz will be available in the build directory.
FreeBSD
Requirements
- curl
- Git
- CMake
- Ninja
- re2c
Instructions
git clone https://github.com/prepkg/ninja.git && cd ninja
./scripts/freebsd/compile.sh
After compilation, the tar.gz will be available in the build directory.