Project layout
To build any project, we should start with a clear understanding of what logical targets are going to be created within it. In this case, we’ll follow the structure shown in the following figure:
Figure 15.2: A structure of logical targets
Let’s explore the structure by following the build order. First, we compile calc_obj
, an object library. For a refresher on object libraries, please check Chapter 5, Working with Targets. We should then turn our attention to static libraries and shared libraries.
Shared libraries versus static libraries
In Chapter 8, Linking Executables and Libraries, we introduced both shared and static libraries. We noted that shared libraries can reduce overall memory usage when multiple programs use the same library. Also, it’s common for users to already have popular libraries installed or to know how to install them quickly.
More importantly, shared libraries are separate files that must be placed...