Skip to content

Conan Profiles

Dandielo edited this page Feb 6, 2023 · 10 revisions

Overview

IBT uses a flexible matching mechanism between Conan dependencies and fastbuild pipelines. To ensure that IBT properly generates fastbuild bindings for conan packages, we need to define a list of conan profiles we want to access.

This list is very similar to what you would find in a conan_profile.txt file. The difference is that it allows to handle multiple profiles in one location, generate all required bindings by IBT.

Definition: profile list
[
  {
    "name": "string", // Used for printing messages and errors when validating the profile
    "id": "string of [a-zA-Z0-1_]", // OS-Unique identifier for this entry. Used to generate directories and identifiers in FastBuild scripts.
    "os": "string of [Windows|Linux]", // Used to filter out profiles not to be used on a specific OS. Same as in Conan.
    "arch": "string of [x86_64]", // Only 64bit currently. Same as in Conan.
    "build_type": "string of [Debug|Release]", // Same as in Conan.
    "compiler": { 
      "name": "string of [Visual Studio|clang|gcc]", // Name of the compiler. Same as in Conan
      "version": "string", // Compiler version. Same as in Conan.
      "libcxx": "string", // The standard library used by this profile. Unix only. Same as in Conan.
    },
    "envs": { // Allows to define environment variables for the given profile.
      "ENV_VAR": "Value"
    }
  }
]

Quick example

The most basic example would provide just two profiles, Debug and Release, for the platform you are developing.

Example: Windows profiles
[
  {
    "name": "Debug",
    "id": "Debug",
    "os": "Windows",
    "arch": "x86_64",
    "build_type": "Debug",
    "compiler": { 
      "name": "Visual Studio",
      "version": "17"
    }
  },
  {
    "name": "Release",
    "id": "Release",
    "os": "Windows",
    "arch": "x86_64",
    "build_type": "Release",
    "compiler": { 
      "name": "Visual Studio",
      "version": "17"
    }
  }
]

With the above definition IBT will download, and build, if necessary, all dependencies for the above profiles. The details of installing these dependencies can be found in the 'build/' directories.

You can also define even more profiles, which may differ compiler, compiler version, build_type, architecture. The only thing to remember is that the id member needs to be unique for the given os.

Example: Windows profiles with Clang-Debug for validation
[
  {
    "name": "Debug",
    "id": "Debug",
    "os": "Windows",
    "arch": "x86_64",
    "build_type": "Debug",
    "compiler": { 
      "name": "Visual Studio",
      "version": "17"
    }
  },
  {
    "name": "Clang Validation Profile (Debug)",
    "id": "Debug_Clang",
    "os": "Windows",
    "arch": "x86_64",
    "build_type": "Debug",
    "compiler": { 
      "name": "clang",
      "version": "14"
    }
  },
  {
    "name": "Release",
    "id": "Release",
    "os": "Windows",
    "arch": "x86_64",
    "build_type": "Release",
    "compiler": { 
      "name": "Visual Studio",
      "version": "17"
    }
  }
]

Clone this wiki locally