Sample app and module added.

The main application uses a simple counter implementation as a module to
show how to setup the GN build files.

Change-Id: I70b112ae1de153a7a864acd965ba47c9c9d1eb60
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/sample_project/+/16501
Commit-Queue: Carlos Chinchilla <cachinchilla@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
7 files changed
tree: 440059ec7c5aca63ff74e8460f176ff1b876d0c8
  1. build_overrides/
  2. source/
  3. third_party/
  4. .gitignore
  5. .gitmodules
  6. .gn
  7. activate.bat
  8. banner.txt
  9. bootstrap.bat
  10. bootstrap.sh
  11. BUILD.gn
  12. BUILDCONFIG.gn
  13. README.md
README.md

Pigweed Sample Project

This repository outlines the recommended way of using Pigweed in a new or existing project. Feel free to fork this repository, or read it as a reference.

For more information see the Pigweed Getting started guide

Check back for more complex examples and features coming soon!

Repository setup

The preferred method to add the Pigweed source is to use git submodules and place the Pigweed source repository in third_party/pigweed. If you forked this repository, don't forget to run git submodule init and git submodule update.

Environment Setup

The scripts bootstrap.bat for Windows, and bootstrap.sh for Unix systems call the respective Pigweed bootstrap scripts. Feel free to modify them to set up your development environment for the first time.

After the initial setup, use the activate.bat in Windows or activate.sh in Unix to enter the environment in a shell.

Banner

Make the project yours with your own banner. Create your own banner and place it in banner.txt.

Sample Application

The sample application in source/main.cc uses the sample module simple_counter. Look at source/BUILD.gn and source/simple_counter/BUILD.gn to see how these are built respectively. The key part is in the root BUILD.gn, which creates the host target using the host toolchain. A toolchain is required for each target.