Managing C++ Build Complexity using Cuppa

Managing C++ Build Complexity using Cuppa

A SCons-based Build System

I recently gave a short talk at the ACCU 2016 conference in Bristol titled “Managing C++ Build Complexity using Cuppa”. In fact I ended up giving the talk the shortened name of “A Quick Cuppa: With SCons”. Due to the time restrictions I added some bonus slides to the deck I presented at the conference. That extended deck is available here.

What's Cuppa?

For those that don't know here is the summary from the second slide in the presentation.

In addition to the content in the actual talk there are two bonus sections. One showing how to generate a useful version file (or files) and another showing how cuppa automatically determines all libraries needed when using boost.

Here is the abstract that was featured in the ACCU 2016 program:

“Building C++ projects is often a complex task with some team members becoming "build" specialists holding the arcane knowledge required to manage a convoluted collection of scripts and make files (including bjam and cmake). SCons, like bjam is a true make replacement but unlike bjam does not require developers to learn yet-another-make-syntax. However, just like make and bjam SCons is a low level tool to help reason about dependencies. Cuppa was written to leverage the extensibility of SCons but to make it easy to solve common build problems in a consistent way. It offers the familiarity of make-like usage but with the very simple, declarative SConscript files.

Key goals of Cuppa are to provide a consistent model for describing what and how things are to be built, in a simple declarative manner, as well as making it easy to encapsulate complex or remote dependencies so that they can be made available automatically during the build process. This makes it trivial to build multiple build variants for multiple toolchains to exactly the specifications required. Being "just Python" there is no need to learn another language and cooperative build ownership becomes much simpler.

This tutorial will introduce Cuppa along with examples of its use. We will also introduce concepts like Cuppa dependencies and show how it is possible to make larger more complex dependencies like boost available for use. In fact boost and Qt are pre-defined dependencies that can be used out-of-the-box with your C++ projects with no, or minimal, fuss. Lastly we will discuss the Cuppa location model that allows dependencies to be expressed as source locations (perhaps in remote version control) so that you can control which specific versions or revisions a given project is to be built against.”