[TOC]
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:
- The default is a debug build. To do a release build add
is_debug = false
- The default is a static build. To do a component build add
is_component_build = true
- The default is a developer build. To do an official build, set
is_official_build = true
- The default is Chromium branding. To do Chrome branding, set
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.