4.2. Setup the Software System - Capture Compile Commands with ccspy

This section describes how to create a new C++ system using ccspy. Select "New""System based on ccspy capturing directory" . Specify the name of the directory of the Sonargraph software system and where its files will be stored. It is a best practice to store the software system close to the actual source code and place it under version control. Using a Quality Model is explained in Section 2.6, “Share Results” ; you can leave this option unchecked for now.

You will have to do a complete rebuild of your system where you replace your compiler with ccspy in your make or cmake configuration. ccspy will then record all compile commands in a designated directory and then call your real compiler. This means you can keep ccspy in your make or cmake configuration. It should only minimally increase the time needed for a build, but will ensure that Sonargraph will always know the latest compile commands.

ccspy is delivered with Sonargraph in the bin directory of the Sonargraph installation. The documentation for properly running and configuring ccspy can be found on Github.

Once your build is finished your ccspy directory should contain one text file for each compilation unit. The ccspy import wizard will guide you through the neccessary steps to complete the Sonargraph system setup and works basically in the same way as the cmake import wizard.

The next step to get started with your analysis is perform a refresh so the required information is picked up from the set-up modules.