Skip to content

Clarify settings/profile #4185

@memsharded

Description

@memsharded

Just to clarify some Conan behavior:

  • The declaration of settings is not intended to be a setup, configuration or activation of the compiler for all cases, but a declaration of the "binary compatibility" of the packages.

  • In some cases, the settings information can be enough, like when using CMake, for selecting the right compiler (like when CMake uses a Visual Studio generator). In these cases it is not Conan automatically configuring the environment, but CMake. But for other cases, specially those that are not the default of the platform, no automatic setup is done by Conan.

  • The tools.build:compiler_executables is defined because it can be a more general approach than using CC/CXX environment variables, because there are build systems that do not listen to these env-vars at all.

  • Conan can use different settings for different packages in the dependency graph, like -s mypgk1*:compiler.version=11 -s mypkg2*:compiler.version=12 if we wanted to build these packages with different compiler versions. This can be configured in profile [buildenv] with per-package environment variables or using [conf] tools.build:compiler_executables, that can also be configured per-package.

Wow. This needs to be put as-is into the docs. Maybe somewhere at the begining of https://docs.conan.io/2/reference/config_files/profiles.html?

If it is already in the docs, I haven't found it. Only after reading this comment, it finally "clicked" for me.

Originally posted by @zbynekwinkler in #14870

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions