Makefile の代わりに XXX.ninja ファイルを使う。
CMake 相等。XXX.ninja ファイルを生成する。
GN は Generate Ninja の略。
Ninja is a small build system with a focus on speed.
GN is a meta-build system that generates build files for Ninja.
Fuchsia OS では、make の代わりに Ninja を使用しています。
Ninja is very simple compared to something like GNU
make. It just compares
times and runs commands and its input files are written by machines, not
humans. However, it builds in some useful things that we bend over > backward
to accomplish in
- Rebuild each file when the command line changes. Command lines will only
really change when GN runs again. But after that, Ninja is smart about
incremental builds re-doing commands for files that have changed and not
re-running commands that haven't changed.
- Handle compiler-generated dependency files. Ninja knows about the makefile
subset that compilers emit in
.dfiles and consumes them directly when
directed to by GN.
- Run with
-j$(getconf _NPROCESSORS_ONLN)by default. You can pass
to serialize or
-j1024when using Goma, but out of the box it does the
parallelism you usually want.
- Prevent interleaved
stderroutput from parallel jobs. Ninja
buffers the output so that error messages don't get garbled by spew from
- Support terse/verbose command output. By default, Ninja emits short
Kbuild-style messages for each command it runs, in a wordy-progress-meter
style. The -v switch is like V=1 in
Kbuild, to show each actual command.
Fuchsia OS では、XXX.ninja ファイル生成のために GN を使用しています。
GN was developed as part of the Chromium project to replace older build
systems. Fuchsia inherited it from them, and it is now used across the tree as
the primary build system.