Build configurations

Updated: May 06, 2022

When you run a project through the launch bar, the IDE builds the project, if necessary, before running the binary on the target. The commands used for compiling and linking are determined by the active build configuration.

You specify the project through the Launch Configuration dropdown, which means you're actually selecting a specific launch configuration for a project. Any launch configuration contains a field for setting the build configuration. This field is found in the Main tab of the Edit Configuration window, which you can access by clicking the Edit button (Icon: Edit button) on the right of the dropdown.

By default, the field is set to Select Automatically, which tells the IDE to select the build configuration based on the launch mode. The build configuration determines the architecture variant (e.g., x86_64, AArch64le) and the version (e.g., debug, profile) of the binary that gets built. Different analysis tools require different binary versions, so your selection in the Launch Mode dropdown must support whichever tool you want to use.

The following table shows the binary version built for each launch mode and which analysis tools are supported when building with default launch configuration settings:
Launch mode Binary version built Tool(s) supported
Run debug (contains debug symbols) GDB debugger (for attaching to the process after it's running)
Debug debug GDB debugger (for attaching to the process when launching it)
Coverage coverage (contains instrumentation code for reporting which lines are executed) Code Coverage
Memory debug Memory Analysis, Application Profiler, or any of the Valgrind tools
Profile profile (contains instrumentation code for reporting execution positions or function entry and exit times) Application Profiler
Check debug Memory Analysis or any of the Valgrind tools
Note: As the table shows, no launch mode automatically selects the release version of the binary. To build and run this version, you must edit the launch configuration to explicitly select a build configuration based on this version, for whatever architecture variant you want to build. For example, you can set Build Configuration to x86_64-release to build a stripped binary (i.e., one with no debug symbols or instrumentation code) for a 64-bit x86 target.
In the Main tab, you can disable automatic selection by explicitly naming a build configuration, as explained in the Build Configuration field description. Next to this field, there's a link with the same name that opens the project properties to the C/C++ Build dialog. This dialog lets you control the finer points of building, such as the make command and the build directory. You can access this dialog at any time by choosing Project > Properties > C/C++ Build. To modify a particular build configuration, you must select it in the dropdown at the top of the main display area:

Screenshot of C/C++ Build dialog in project properties