Startup demo for GN/Ninja build system.
$ git clone https://gn.googlesource.com/gn
$ cd gn
$ python build/gen.py
$ ninja -C out
The standalone gn tools will located in gn/out
directory. Please add the path to your $PATH env.
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
The Ninja tools will located in depot_tools directory. Please add the path to your $PATH env.
$ gn gen out/Debug
$ ninja -C out/Debug
The outputs will be found in out/Debug/
directory.
- Look for .gn file in the current directory and walk up the directory tree until one is found. Set this directory to be the “source root” and interpret this file to find the name of the build config file.
- Execute the build config file (The name of this file is specified in the .gn file that marks the root of the repository, this is the default toolchain).
- Load the BUILD.gn file in the root directory.
- Recursively load BUILD.gn in other directories to resolve all current dependencies. If a BUILD file isn't found in the specified location, GN will look in the corresponding location inside tools/gn/secondary.
- When a target's dependencies are resolved, write out the .ninja file to disk.
- When all targets are resolved, write out the root build.ninja file.
Email:[email protected]