Implementation of the profiles configuration.
A profile is a named collection of features that can be applied together. Profiles provide a convenient way to group features for different use cases, such as debug builds, release builds, or specific target configurations.
A profile table has the following structure:
[profiles.debug]
features = ["debug-flags", "development-tools"]
[profiles.release]
features = ["optimized", "strip-symbols"]
Configuration data for a profile
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(string_t), | public, | allocatable | :: | features(:) |
List of features to apply |
||
character(len=:), | public, | allocatable | :: | name |
Profile name |
generic, public :: dump => dump_to_toml, dump_to_file, dump_to_unit | |
procedure, public :: dump_to_toml | |
procedure, public :: info | Print information on this instance |
generic, public :: load => load_from_toml, load_from_file, load_from_unit | |
procedure, public :: load_from_toml | |
generic, public :: operator(==) => serializable_is_same | |
procedure, public :: serializable_is_same => profile_is_same | Serialization interface |
procedure, public, non_overridable :: test_serialization | Test load/write roundtrip |
Add default profiles to existing profiles array if they don’t already exist
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(profile_config_t), | intent(inout), | allocatable | :: | profiles(:) |
Instance of the profile configuration array (will be resized) |
|
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Create default profiles with standard features
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(profile_config_t), | intent(out), | allocatable | :: | profiles(:) |
Instance of the profile configuration array |
|
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Construct a new profile configuration from a TOML array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(profile_config_t), | intent(out) | :: | self |
Instance of the profile configuration |
||
type(toml_array), | intent(inout) | :: | features_array |
TOML array containing the feature names |
||
character(len=*), | intent(in) | :: | profile_name |
Name of the profile |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Construct new profiles array from a TOML data structure
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(profile_config_t), | intent(out), | allocatable | :: | profiles(:) |
Instance of the profile configuration array |
|
type(toml_table), | intent(inout) | :: | table |
Instance of the TOML data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |