Skip to main content
Given the shortcomings of alternatives like cmake, Bazel is a pretty great choice for C++ applications, even if you don’t need a multi-language or multi-application monorepo. We’ll use the following tools and libraries: Before starting the course, we assume you’ve already taken Bazel 101. You should also run aspect init and select the “C/C++” option, as well as Linting, Stamping, and OCI containers if you’d like to learn these. Watch a live presentation of this course:

Outline

Running a “hello world” application Link against pre-installed system libraries Build external dependencies from source Configuring the IDE or editor Testing and debugging with GoogleTest Cross-compilation to target platforms Linting and Formatting BUILD file generation

Topics we may cover in the future

  • Link against external dependencies from a distro like Debian
    • apko or APT
    • RPATH in ELF header
    • point to some ruleset
  • Embedding C++ code in other languages with Foreign Function Interfaces
    • Binding to a dylib vs static link into program
    • Go (cgo)
    • Python (pybind)
    • npm (gyp)
    • Java (SWIG)
  • Alternative toolchains
    • musl syscall implementations (doesn’t need runtime linking)
  • Sanitizers
    • Asan
    • Ubsan
    • Tsan
I