cargo::core

Module profiles

source
Expand description

Handles built-in and customizable compiler flag presets.

Profiles is a collections of built-in profiles, and profiles defined in the root manifest and configurations.

To start using a profile, most of the time you start from Profiles::new, which does the followings:

Then you can query a Profile via Profiles::get_profile, which respects the profile overridden hierarchy described in below. The Profile you get is basically an immutable struct containing the compiler flag presets.

Β§Profile overridden hierarchy

Profile settings can be overridden for specific packages and build-time crates. The precedence is explained in ProfileMaker. The algorithm happens within ProfileMaker::get_profile.

Structs§

  • Profile settings used to determine which compiler flags to use for a target.
  • ProfileMaker πŸ”’
    An object used for handling the profile hierarchy.
  • Collection of all profiles.
  • Flags used in creating Units to indicate the purpose for the target, and to ensure the target’s dependencies have the correct settings.

Enums§

Functions§

  • Helper for fetching a profile from config.
  • is_off πŸ”’
    Returns true if a string is a toggle that turns an option off.
  • Takes the manifest profiles, and overlays the config profiles on-top.
  • merge_profile πŸ”’
    Merge the given TOML profile into the given Profile.
  • Merge package and build overrides from the given TOML profile into the given Profile.
  • Validate that a package does not match multiple package override specs.
  • Check for any profile override specs that do not match any known packages.