n2 (pronounced "into") implements enough of ninja to successfully build some projects that build with ninja.
I wrote it to explore some alternative ideas I had around how to structure a build system.
Here's a small demo of n2 building some of Clang.
$ cargo build --release
$ ./target/release/n2 -C some/build/dir
When CMake executes Ninja it expects some particular Ninja behaviors. n2
emulates these behaviors when invoked as ninja
, so to use it with CMake
you can ln -s path/to/n2 ninja
to create a symlink named ninja
somewhere in
your $PATH
such that CMake can discover it.
n2 is missing many Ninja features.
n2 does some things Ninja doesn't:
- Builds start tasks as soon as an out of date one is found, rather than gathering all the out of date tasks before executing.
- Fancier status output, modeled after Bazel.
-d trace
generates a performance trace as used by Chrome'sabout:tracing
or alternatives (speedscope, perfetto).