tree: 291b29f60621f9e102470f2d835a1f1d6a51d1ce [path history] [tgz]
  1. boards.mako
  2. BUILD.gn
  3. create_gn_rules.py
  4. fidl.mako
  5. header.mako
  6. host_tool.mako
  7. list_boards.py
  8. list_source_files.py
  9. main.mako
  10. MAINTAINERS
  11. README.md
  12. shared_library.mako
  13. source_library.mako
  14. static_library.mako
  15. sysroot.mako
zircon/README.md

GN support for Zircon

This folder contains utilities that help Zircon artifacts better integrate into the GN build without having to manually maintain GN build files in sync with the existing rules.mk build files specific to Zircon. It also makes it so that targets in upper layers don‘t need to know about the structure of Zircon’s output directory in order to use Zircon build artifacts, as knowledge of that structure is confined within the generated GN build files.

Process

The main build file //build/gn/BUILD.gn calls the //build/zircon/create_gn_rules.py script to produce BUILD.gn files for Zircon.

That script uses a special, fast build of Zircon (make packages) to generate manifests for artifacts that are meant to be consumed by upper layers of the Fuchsia stack. These manifest are then turned into GN build files under //zircon/public whose targets other parts of the codebase can depend on.

This script is run early in the build process, before any other build file gets evaluated. This ensure that non-Zircon build files can safely depend on the generated targets.

In order to keep the generated build files up-to-date, that process is repeated every time a file changes under //zircon.

Note that the generated GN files should only depend on the Zircon source code. Invoking the Fuchsia build with different parameters on the same codebase should produce identical files.