Profile plugin

The profile.py extension plugin is a Python script that receives one profile and allow checking and modifying it.

This plugin is located in the extensions/plugins/profile.py cache folder.

This profile.py contains a default implementation that does:

  • Will try to define compiler.runtime_type for msvc and clang compilers (in Windows) if it is not defined, and it will define it to match the settings.build_type. That allow users to let it undefined in profiles, and switch it conveniently in command line just with -s build_type=Debug

  • Will check the compiler.cppstd value if defined to validate if the current compiler version has support for it. For example, if a developer tries to use -s compiler=gcc -s compiler.version=5 -s compiler.cppstd=20, it will raise an error.

Users can customize this profile.py and distribute it via conan config install, in that case, the first lines should be removed:

# This file was generated by Conan. Remove this comment if you edit this file or Conan
# will destroy your changes.

And profile.py should contain one function with the signature:

def profile_plugin(profile):
    settings = profile.settings
    print(settings)

When a profile is computed, it will display something like:

OrderedDict([('arch', 'x86_64'), ('build_type', 'Release'), ('compiler', 'msvc'), ('compiler.cppstd', '14'), ('compiler.runtime', 'dynamic'), ('compiler.runtime_type', 'Release'), ('compiler.version', '192'), ('os', 'Windows')])

See also