How to manage build configurations when working with C/C++ applications
Build configurations are a powerful thing in TimeStorm: it allows you to make ‘variants’ of a project. The project will share the common things, and you can simply tweak things one way or the other for example to produce a ‘release’ or a ‘debug’ binary of your application without duplicating the project.
This document will show How to manage build configurations when working with C/C++ applications. To manage build configurations in TimeStorm follow the below steps.- Create and configure new build configurations
- Activate and use new build configuration
- Rename and Delete the build configuration
1. Create and configure new build configuration:
Build configurations are managed through either the context menu on the project or with the top menu as shown below.
With the ‘Manage’ option you can manage your configurations:
Debug vs Release configurations:
Debug: Debug builds have debugging and symbolic information included. The compiler is not optimizing to make debugging ‘easier’.
Release: Release builds have the debugging and symbolic information stripped off. Optimizations are enabled for best performance or code density.
So the idea is that you have something easy to develop and debug. And once everything works, you create the optimized Release version and ship. That makes much sense, especially as the binary file size is greatly reduced with the debug information stripped off. Additionally, loading that file is faster too, as it is smaller in size. So a lot of good reasons to create a Release version.
To illustrate, create a new ‘Release’ configuration with the ‘New’ button:
It is a good practice to give a name and an optional description. Start with copy settings from an existing configuration. That way you get a new configuration with a good starting point. After cloning, giving a name and a description, click on the OK button.
Adding Compiler/Linker Flags to build configurations:
Adding Compiler/Linker Flags to Individual/Multiple/All Configurations by selecting from the configurations drop down as shown below.
Adding a Compiler/Linker Flags to Individual configurations:
Adding a Compiler/Linker Flags to individual configurations by selecting from the configurations dropdown, for example: adding a GCC Compiler’s Optimization flag (-O2) to Debug configuration will add to Debug configuration only and not to other configurations (Release/GNU Profile).
Adding a Compiler/Linker Flags to Multiple configurations:
Adding a Compiler/Linker Flags to multiple configurations by selecting [Multiple Configurations...] from the configurations dropdown as shown below.
After clicking on the Multiple Configurations option which will display the list of available configurations as shown below.
In the Select Configurations, select at least 2 configurations and click on the OK button. For example: adding a GCC Compiler’s Optimization flag (-O3) to multiple configurations (Debug and Release) will add to Debug and Release configurations as shown below.
Adding a Compiler/Linker Flags to All configurations:
Adding a Compiler/Linker Flags to All configurations by selecting [All Configurations] from the configurations dropdown, for example: adding a GCC Compiler’s Optimization flag (-O1) to all configurations will add to all configurations (Debug, Release and GNU Profile).
After adding Compiler/Linker flags to the configurations, click on Apply and Close to apply the changes.
2. Activate and use new build option
One configuration is always active, and the ‘manage’ dialog (Right click on the project --> Build Configuration --> Manage) can be used to change the active configuration. To activate the ‘Release’ configuration, select and click on the ‘setActive’ button.
After activating the configuration, build the project. The configuration name is used as the name for the output folder name:
That way for each configuration separate binaries are built.
3. Rename and Delete the build Configuration:
You can rename and delete the build option by using the ‘manage’ dialog (Right click on the project --> Build Configuration --> Manage). In the manage dialog you can see Delete and Rename buttons, by using them you can delete and rename the build option.