From 84f234e8e153f82c0dd570815243d81f5905e75c Mon Sep 17 00:00:00 2001 From: Rob Mohr Date: Fri, 6 Dec 2019 09:16:50 -0800 Subject: [PATCH] Add doc for pw_build. Change-Id: I2b8b234adadfffc7c3d533613b15fa54ab3d3d8f --- pw_build/build.rst | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 pw_build/build.rst diff --git a/pw_build/build.rst b/pw_build/build.rst new file mode 100644 index 000000000..acea1c552 --- /dev/null +++ b/pw_build/build.rst @@ -0,0 +1,34 @@ +.. _chapter-build: + +.. default-domain:: cpp + +.. highlight:: sh + +-------- +pw_build +-------- +The build module contains the configuration necessary to build Pigweed using +either `GN`_/`Ninja`_ or `Bazel`_. + +.. _GN: https://gn.googlesource.com/gn/ +.. _Ninja: https://ninja-build.org/ +.. _Bazel: https://bazel.build/ + +GN / Ninja +========== +The common configuration for GN for all modules is in the ``BUILD.gn`` file. +It contains ``config`` declarations referenced by ``BUILD.gn`` files in other +modules. + +The ``pw_executable.gni`` file contains a wrapper to build a target for the +globally-defined target type, and ``python_script.gni`` makes it easy to run +Python scripts as part of build rules. + +Bazel +===== +The common configuration for Bazel for all modules is in the ``pigweed.bzl`` +file. The built-in Bazel rules ``cc_binary``, ``cc_library``, and ``cc_test`` +are wrapped with ``pw_cc_binary``, ``pw_cc_library``, and ``pw_cc_test``. +These wrappers add parameters to calls to the compiler and linker. + +The ``BUILD`` file is merely a placeholder and currently does nothing.