fpm_manifest_profile Module

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"]


Derived Types

type, public, extends(serializable_t) ::  profile_config_t

Configuration data for a profile

Components

Type Visibility Attributes Name Initial
type(string_t), public, allocatable :: features(:)

List of features to apply

character(len=:), public, allocatable :: name

Profile name

Type-Bound Procedures

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


Subroutines

public subroutine add_default_profiles(profiles, error)

Add default profiles to existing profiles array if they don’t already exist

Arguments

Type IntentOptional 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

public subroutine get_default_profiles(profiles, error)

Create default profiles with standard features

Arguments

Type IntentOptional 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

public subroutine new_profile(self, features_array, profile_name, error)

Construct a new profile configuration from a TOML array

Arguments

Type IntentOptional 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

public subroutine new_profiles(profiles, table, error)

Construct new profiles array from a TOML data structure

Arguments

Type IntentOptional 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