Development Setup
Requirements
- LLVM 13 including
clang++
,opt
,clang-format
,clang-tidy
, andlibc++
. - Python 3, and Pylint and YAPF to format and lint code.
- Bazel build system.
- Material for MkDocs to generate documentation.
Bazel configuration
Check out the bazelrc
files in the .build
folder to help configure Spoor
for your environment.
Build
bazel build //...
Test
bazel test //...
Style and lint
Format C++, Objective-C, and Python
bazel build //... --aspects toolchain/style/style.bzl%format --output_groups=report
Format Starlark
bazel run //toolchain/style:buildifier
Lint C++ and Python
bazel build //... --aspects toolchain/style/style.bzl%lint --output_groups=report
CI toolchain
CI uses the LLVM toolchain when running the linter.
--crosstool_top=//toolchain/crosstool:llvm_toolchain
Add copyright header
./toolchain/copyright_header/add_copyright_header.sh
Compilation database
Generate a compile_commands.json
compilation database used by Clang Tidy for
linting and by some IDEs to offer code completion.
Details.
./toolchain/compilation_database/generate_compilation_database.sh
Documentation
Build
mkdocs build
Live preview server
mkdocs serve
INFO - Building documentation...
INFO - Cleaning site directory
INFO - Documentation built in 0.80 seconds
INFO - [00:00:00] Serving on http://127.0.0.1:8000/