GNAT project files have the concept of scenario variables that allow considerable flexibility in controlling how the tools build an executable. (See Scenario Variables for details on scenario variables, and GNAT Projects for the details of GNAT project files.) You can define, for example, different scenarios for debugging and releases, in which optimization and symbolic information are either present or not, respectively.
GNATbench provides the Scenario View for managing scenario variables. The idea is that you can control the build by changing the values of the scenario variables within this view. (See Scenario View for details.)
The wizard that created our new project also created the corresponding GNAT project file for us. It is shown below. Note the scenario variable named "Mode".
The variable Mode has two possible values because of its type: "Release" and "Debug". (These values are case-sensitive because they are strings.) As you have guessed, these two values represent two different build scenarios. "Release" corresponds to the scenario in which you build for actual delivery. The "Debug" scenario is for development and testing. Therefore, these scenarios require different switches to be applied and this fact is reflected in the content of the project file. Note in particular the switches set in the package Compiler depending on the value of Mode. You will see these switches applied in the build console.
The initial value of Mode is "Debug" because that is the default:
If we build the project with that value for Mode we will see the corresponding debugging switches set:
If we change the value of "BUILD" to "Release"
and then rebuild we will see the different switches applied: