GN, a meta-build system that generates Ninja build files
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
build_overrides Update gn to version 29b1eb6 from chromium source Oct 23, 2017
testing Update gn to version c498275 from chromium source Nov 11, 2017
third_party Merge branch 'chromium-gn' into master Nov 11, 2017
tools/gn Merge branch 'chromium-gn' into master Nov 11, 2017
.appveyor.yml Update CI builds to use ninja v1.8.2 Oct 24, 2017
.gitattributes Support building GN from a git archive May 17, 2017
.gitignore Update .gitignore list Oct 20, 2017
LICENSE Initial commit for gn from chromium source Nov 3, 2015
LICENSE.chromium_os Initial commit for gn from chromium source Nov 3, 2015


travis-ci status appveyor-ci status

Generate-Ninja, or GN, is a meta-build system that generates Ninja build files so that you can build your project with Ninja.

GN is, originally, part of the Chromium source tree. However, this is a fork of the original GN, which has been extracted from the Chromium tree so that it may be built standalone.

The original source code was imported from Chromium with the following files/directories exported directly via git archive:

  • .gn
  • LICENSE.chromium_os
  • base
  • build
  • build_overrides
  • tools/gn
  • testing/gmock
  • testing/gtest
  • testing/perf
  • testing/libfuzzer
  • testing/test.gni
  • testing/*.h
  • testing/*.cc
  • testing/*.mm
  • third_party/apple_apsl
  • third_party/ced
  • third_party/googletest
  • third_party/libxml
  • third_party/modp_b64
  • third_party/tcmalloc
  • third_party/win_build_output
  • third_party/zlib

and the following git sub-repos exported into their respective directories:

  • third_party/ced/src
  • third_party/icu
  • third_party/googletest/src

Furthermore, this fork adds some minor features as well as some bug fixes:

  • Create build dir when necessary if it does not exist
  • Change ordering of libs and config flags such that dependent libs and config flags have the least precedence
  • Fix bootstrap builds
  • Fix unresolved dependencies for sub-configs
  • Fix invalid characters list for ninja rule names
  • Fix help messages title for GN commands
  • Fix duplicate pch ninja rules
  • Fix action targets not using substitutions
  • Fix errors when root build dir equals source root
  • Fix static library link order to fix unresolved symbol link errors
  • Fix --all-toolchains flag for gn ls and gn refs
  • Fix gn args regenerating ninja files with different command-line switches
  • Support binary targets for get_target_outputs function
  • Support source substitutions for binary targets
  • Support for command in action targets
  • Support for description in action targets
  • Support for sys_include_dirs
  • Support for cppflags and asmppflags
  • Support for source extension substitution
  • Support specifying tool source file extentions
  • Support specifying object file extentions
  • Support specifying linker script extentions
  • Support custom interpreter for action scripts and exec scripts
  • Support custom interpreter for JSON IDE scripts
  • Support --all-toolchains option for QtCreator generator
  • Add define_switch and include_switch variables to toolchain function
  • Add color_console built-in variable
  • Add console_pool built-in variable
  • Add gn_version built-in variable
  • Allow gn desc to support multiple target labels
  • Allow clobbering in forward_variables_from
  • Use console pool to regenerate ninja files
  • Use abs path for sources when output dir is outside root dir

For more information on GN and Ninja, please refer to the following links: