GN has extensive built-in help, so you can run gn help
, but you can also see all of the help on the reference page. See also the quick start guide and the language and operation details.
You can generate skeleton (or wrapper) projects for Xcode, Visual Studio, QTCreator, and Eclipse that will list the files and targets in the build, but use Ninja to do the actual build. You cannot generate “real” projects that look like native ones like GYP could.
Run gn help gen
for more details.
In GN, args go with a build directory rather than being global in the environment. To edit the args for your out/Default
build directory:
gn args out/Default
You can set variables in that file:
is_debug = false
is_component_build = true
is_official_build = true
is_chrome_branded = true
GN has robust support for doing cross compiles and building things for multiple architectures in a single build.
See GNCrossCompiles for more info.
Yes! If you create a group target called “default” in the top-level (root) build file, i.e., “//:default”, GN will tell Ninja to build that by default, rather than building everything.
There's at least one, from 2015. There haven't been big changes since then apart from moving it to a standalone repo, so it should still be relevant.