Support building CHIP with GN (#1456)

* Add nlunit-test to GN build

* Add nlassert to GN build

* Add nlfaultinjection to GN build

* Add nlio to GN build

* Add GN files to gitignore

* Add GN build support using pw_toolchain & pw_build

This uses build infrastructure from pigweed to enable building CHIP with
GN.

* Add lwIP to GN build

* Add Mbed TLS to GN build

* Add SystemConfig to GN build

* Add CHIPConfig to GN build

* Add src/lib/support to GN build

* Add src/system to GN build

* Add src/inet to GN build

* Add BLE to GN build

* Add src/lib/core to GN build

* Add src/controller to GN build

* Add libCHIP.a to GN build

* Add src/system/tests to GN build

* Add CHIPVersion.h generation to GN build

* Add src/lib/support/tests to GN build

* Add src/inet/tests to GN build

* Add src/ble/tests to GN build

* Add src/lib/core/tests to GN build

* Add src/crypto to GN build

* Add src/app to GN build

* Add src/crypto/tests to GN build

* Add support for building nRF5 lock app

* Run unit tests with some help from pigweed

This enables running tests during the build. Just run

  gn gen out/debug
  ninja -C out/debug check

* Add qrcodetool to GN build

* Add transport to GN build

* Add src/setup_payout/tests to GN build

* Add src/setup_payload to GN build

* Add ARM toolchain support

* Make the build relocatable

* Add nRF5 lock example superproject build

* Add support for combined build via target_os="all"

This configures host_clang, host_gcc, and nRF5 lock app.

To run a maximal build:

  gn gen out/debug --args='target_os="all"'
  ninja -C out/debug check

* Make bootstrap display cleaner

* Add GN build wrapper script

This script does an end to end bootstrap & build with GN from a fresh
clone.

Usage: ./gn_build.sh

* Add examples/chip-tool to GN build

* Remove shared imports

Importing everything from chip.gni will require some dependencies to be
present even if they are not used. Import overrides separately.

Also add args to disable various builds at the top level.

* Add transport tests to GN build

* Add examples/shell to GN build

* Add tips to gn_build.sh

To run a GN build of chip:
  ./gn_build.sh

* Enable building with homebrew openssl on Mac via pkg-config

* Add mbedtls build to top level build

* Add nRF5 lock app back to example build

But only if NRF5_SDK_ROOT is set in the environment.

* Harmonize library outputs with automake

This changes most libraries to match the names used by automake.

* Restyled by shfmt

* Move the GN build files to //gn

And use the secondary_source feature to still allow loading them via
//build. This breaks using ${chip_root} in superproject builds, but that
was unnecessary anyway.

We should try to unwind this later as it causes some confusion about
what path to specify.

* Fix lint warning "Except block directly handles BaseException"

* Move activate above bootstrap

The usual case is to source activate.sh, not bootstrap.sh, so move that
first. bootstrap.sh is only needed after an update.

* Add github actions for GN

* Move project specific build logic to gn/chip

* Add comments to GN build GitHub workflow helpers

* Fix the nRF5 lock app CI build

Remove a broken link that was left behind after moving build files to //gn.

* Updating Build Version

* Re-merge repos.conf with .gitmodules

This was unmerged by a recent commit.

* Move bootstrap.sh & activate.sh to scripts

* Fixup activate.sh & bootstrap.sh after moving

Co-authored-by: Keir Mierle <keir@google.com>
Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Justin Wood <woody@apple.com>
105 files changed
tree: 6d291d991949dac46810719e1be1612f5ad10f68
  1. .devcontainer/
  2. .github/
  3. .vscode/
  4. autoconf/
  5. config/
  6. docs/
  7. examples/
  8. gn/
  9. integrations/
  10. scripts/
  11. src/
  12. third_party/
  13. tools/
  14. .chip-banner.txt
  15. .clang-format
  16. .default-version
  17. .default-version.min
  18. .dir-locals.el
  19. .editorconfig
  20. .gitignore
  21. .gitmodules
  22. .gn
  23. .prettierrc.json
  24. .pullapprove.yml
  25. .restyled.yaml
  26. .shellcheck_tree
  27. bootstrap
  28. BUILD.gn
  29. CODE_OF_CONDUCT.md
  30. configure.ac
  31. CONTRIBUTING.md
  32. gn_build.sh
  33. LICENSE
  34. Makefile-Android
  35. Makefile-bootstrap
  36. Makefile-Standalone
  37. Makefile.am
  38. README.md
  39. REVIEWERS.md
README.md

Connected Home over IP

Main Examples QEMU

What is Project Connected Home over IP?

Visit connectedhomeip.com to learn more.

Current Status of Project Connected Home over IP

The Zigbee Alliance officially opened the Project Connected Home over IP (Project CHIP) Working Group on January 17 and is in the process of drafting the specification.

The Project’s design and technical processes are intended to be open and transparent to the general public, including to Work Group non-members wherever possible. The availability of this GitHub repository and its source code under an Apache v2 license is an important and demonstrable step to achieving this commitment.

The Project endeavors to bring together the best aspects of market-tested technologies and to redeploy them as a unified and cohesive whole-system solution. The overall goal of this approach is to bring the benefits of the Project to consumers and manufacturers as quickly as possible. As a result, what you observe in this repository is an implementation-first approach to the technical specification, vetting integrations in practice.

How to Contribute

We would love for you to contribute to Project Connected Home over IP. Read our contribution guidelines here.

Building and Developing in Project

Instructions about how to build Project Connected Home over IP can be found here.

Directory Structure

The Connected Home over IP repository is structured as follows:

File / FolderContents
.default-versionDefault Project CHIP version if none is available via source code control tags, .dist-version, or .local-version
bootstrapGNU autotools bootstrap script for the Project CHIP build system
bootstrap-configureConvenience script that will bootstrap the Project CHIP build system, via bootstrap, and invoke configure
build/Build system support content and build output directories
BUILDING.mdMore detailed information on configuring and building Project CHIP for different targets
CODE_OF_CONDUCT.mdCode of Conduct for Project CHIP, and contributions to it
CONTRIBUTING.mdGuidelines for contributing to Project CHIP
CONTRIBUTORS.mdContributors to Project CHIP
docs/Documentation
examples/Example firmware applications that demonstrate use of Project CHIP technology
integrations/Third party integrations related to this project
integrations/docker/Docker scripts and Dockerfiles
LICENSEProject CHIP License file (Apache 2.0)
Makefile-AndroidConvenience makefile for building Project CHIP against Android
Makefile-StandaloneConvenience makefile for building Project CHIP as a standalone package on desktop and server systems
README.mdThis file
src/Implementation of Project CHIP
third_party/Third-party code used by Project CHIP
tools/Tools needed to work with the Project CHIP repo

License

Project CHIP is released under the Apache 2.0 license.