settings.yml

This configuration file is located in the Conan user home, i.e., [CONAN_HOME]/settings.yml. It looks like this:

  1. # This file was generated by Conan. Remove this comment if you edit this file or Conan
  2. # will destroy your changes.
  3. os:
  4. Windows:
  5. subsystem: [null, cygwin, msys, msys2, wsl]
  6. WindowsStore:
  7. version: ["8.1", "10.0"]
  8. WindowsCE:
  9. platform: [ANY]
  10. version: ["5.0", "6.0", "7.0", "8.0"]
  11. Linux:
  12. iOS:
  13. version: &ios_version
  14. ["7.0", "7.1", "8.0", "8.1", "8.2", "8.3", "8.4", "9.0", "9.1", "9.2", "9.3",
  15. "10.0", "10.1", "10.2", "10.3",
  16. "11.0", "11.1", "11.2", "11.3", "11.4",
  17. "12.0", "12.1", "12.2", "12.3", "12.4", "12.5",
  18. "13.0", "13.1", "13.2", "13.3", "13.4", "13.5", "13.6", "13.7",
  19. "14.0", "14.1", "14.2", "14.3", "14.4", "14.5", "14.6", "14.7", "14.8",
  20. "15.0", "15.1", "15.2", "15.3", "15.4", "15.5", "15.6", "15.7", "15.8",
  21. "16.0", "16.1", "16.2", "16.3", "16.4", "16.5", "16.6", "16.7",
  22. "17.0", "17.1", "17.2", "17.3", "17.4", "17.5", "17.6", "17.8",
  23. "18.0", "18.1"]
  24. sdk: ["iphoneos", "iphonesimulator"]
  25. sdk_version: [null, "11.3", "11.4", "12.0", "12.1", "12.2", "12.4",
  26. "13.0", "13.1", "13.2", "13.4", "13.5", "13.6", "13.7",
  27. "14.0", "14.1", "14.2", "14.3", "14.4", "14.5", "15.0", "15.2", "15.4",
  28. "15.5", "16.0", "16.1", "16.2", "16.4", "17.0", "17.1", "17.2", "17.4", "17.5",
  29. "18.0", "18.1"]
  30. watchOS:
  31. version: ["4.0", "4.1", "4.2", "4.3", "5.0", "5.1", "5.2", "5.3", "6.0", "6.1", "6.2", "6.3",
  32. "7.0", "7.1", "7.2", "7.3", "7.4", "7.5", "7.6",
  33. "8.0", "8.1", "8.3", "8.4", "8.5", "8.6", "8.7",
  34. "9.0","9.1", "9.2", "9.3", "9.4", "9.5", "9.6",
  35. "10.0", "10.1", "10.2", "10.3", "10.4", "10.5", "10.6",
  36. "11.0", "11.1"]
  37. sdk: ["watchos", "watchsimulator"]
  38. sdk_version: [null, "4.3", "5.0", "5.1", "5.2", "5.3", "6.0", "6.1", "6.2",
  39. "7.0", "7.1", "7.2", "7.4", "8.0", "8.0.1", "8.3", "8.5", "9.0", "9.1",
  40. "9.4", "10.0", "10.1", "10.2", "10.4", "10.5", "11.0", "11.1"]
  41. tvOS:
  42. version: ["11.0", "11.1", "11.2", "11.3", "11.4",
  43. "12.0", "12.1", "12.2", "12.3", "12.4",
  44. "13.0", "13.2", "13.3", "13.4",
  45. "14.0", "14.2", "14.3", "14.4", "14.5", "14.6", "14.7",
  46. "15.0", "15.1", "15.2", "15.3", "15.4", "15.5", "15.6",
  47. "16.0", "16.1", "16.2", "16.3", "16.4", "16.5", "16.6",
  48. "17.0", "17.1", "17.2", "17.3", "17.4", "17.5", "17.6",
  49. "18.0", "18.1"]
  50. sdk: ["appletvos", "appletvsimulator"]
  51. sdk_version: [null, "11.3", "11.4", "12.0", "12.1", "12.2", "12.4",
  52. "13.0", "13.1", "13.2", "13.4", "14.0", "14.2", "14.3", "14.5", "15.0",
  53. "15.2", "15.4", "16.0", "16.1", "16.4", "17.0", "17.1", "17.2", "17.4", "17.5",
  54. "18.0", "18.1"]
  55. visionOS:
  56. version: ["1.0", "1.1", "1.2", "2.0", "2.1"]
  57. sdk: ["xros", "xrsimulator"]
  58. sdk_version: [null, "1.0", "1.1", "1.2", "2.0", "2.1"]
  59. Macos:
  60. version: [null, "10.6", "10.7", "10.8", "10.9", "10.10", "10.11", "10.12", "10.13", "10.14", "10.15",
  61. "11.0", "11.1", "11.2", "11.3", "11.4", "11.5", "11.6", "11.7",
  62. "12.0", "12.1", "12.2", "12.3", "12.4", "12.5", "12.6", "12.7",
  63. "13.0", "13.1", "13.2", "13.3", "13.4", "13.5", "13.6", "13.7",
  64. "14.0", "14.1", "14.2", "14.3", "14.4", "14.5", "14.6", "14.7",
  65. "15.0", "15.1"]
  66. sdk_version: [null, "10.13", "10.14", "10.15", "11.0", "11.1", "11.3", "12.0", "12.1",
  67. "12.3", "13.0", "13.1", "13.3", "14.0", "14.2", "14.4", "14.5",
  68. "15.0", "15.1"]
  69. subsystem:
  70. null:
  71. catalyst:
  72. ios_version: *ios_version
  73. Android:
  74. api_level: [ANY]
  75. ndk_version: [null, ANY]
  76. FreeBSD:
  77. SunOS:
  78. AIX:
  79. Arduino:
  80. board: [ANY]
  81. Emscripten:
  82. Neutrino:
  83. version: ["6.4", "6.5", "6.6", "7.0", "7.1"]
  84. baremetal:
  85. VxWorks:
  86. version: ["7"]
  87. arch: [x86, x86_64, ppc32be, ppc32, ppc64le, ppc64,
  88. armv4, armv4i, armv5el, armv5hf, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, arm64ec,
  89. sparc, sparcv9,
  90. mips, mips64, avr, s390, s390x, asm.js, wasm, sh4le,
  91. e2k-v2, e2k-v3, e2k-v4, e2k-v5, e2k-v6, e2k-v7,
  92. riscv64, riscv32,
  93. xtensalx6, xtensalx106, xtensalx7,
  94. tc131, tc16, tc161, tc162, tc18]
  95. compiler:
  96. sun-cc:
  97. version: ["5.10", "5.11", "5.12", "5.13", "5.14", "5.15"]
  98. threads: [null, posix]
  99. libcxx: [libCstd, libstdcxx, libstlport, libstdc++]
  100. gcc:
  101. version: ["4.1", "4.4", "4.5", "4.6", "4.7", "4.8", "4.9",
  102. "5", "5.1", "5.2", "5.3", "5.4", "5.5",
  103. "6", "6.1", "6.2", "6.3", "6.4", "6.5",
  104. "7", "7.1", "7.2", "7.3", "7.4", "7.5",
  105. "8", "8.1", "8.2", "8.3", "8.4", "8.5",
  106. "9", "9.1", "9.2", "9.3", "9.4", "9.5",
  107. "10", "10.1", "10.2", "10.3", "10.4", "10.5",
  108. "11", "11.1", "11.2", "11.3", "11.4", "11.5",
  109. "12", "12.1", "12.2", "12.3", "12.4",
  110. "13", "13.1", "13.2", "13.3",
  111. "14", "14.1", "14.2"]
  112. libcxx: [libstdc++, libstdc++11]
  113. threads: [null, posix, win32] # Windows MinGW
  114. exception: [null, dwarf2, sjlj, seh] # Windows MinGW
  115. cppstd: [null, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20, 23, gnu23, 26, gnu26]
  116. cstd: [null, 99, gnu99, 11, gnu11, 17, gnu17, 23, gnu23]
  117. msvc:
  118. version: [170, 180, 190, 191, 192, 193, 194]
  119. update: [null, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  120. runtime: [static, dynamic]
  121. runtime_type: [Debug, Release]
  122. cppstd: [null, 14, 17, 20, 23]
  123. toolset: [null, v110_xp, v120_xp, v140_xp, v141_xp]
  124. cstd: [null, 11, 17]
  125. clang:
  126. version: ["3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "4.0",
  127. "5.0", "6.0", "7.0", "7.1",
  128. "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"]
  129. libcxx: [null, libstdc++, libstdc++11, libc++, c++_shared, c++_static]
  130. cppstd: [null, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20, 23, gnu23, 26, gnu26]
  131. runtime: [null, static, dynamic]
  132. runtime_type: [null, Debug, Release]
  133. runtime_version: [null, v140, v141, v142, v143, v144]
  134. cstd: [null, 99, gnu99, 11, gnu11, 17, gnu17, 23, gnu23]
  135. apple-clang:
  136. version: ["5.0", "5.1", "6.0", "6.1", "7.0", "7.3", "8.0", "8.1", "9.0", "9.1",
  137. "10.0", "11.0", "12.0", "13", "13.0", "13.1", "14", "14.0", "15", "15.0", "16", "16.0"]
  138. libcxx: [libstdc++, libc++]
  139. cppstd: [null, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20, 23, gnu23, 26, gnu26]
  140. cstd: [null, 99, gnu99, 11, gnu11, 17, gnu17, 23, gnu23]
  141. intel-cc:
  142. version: ["2021.1", "2021.2", "2021.3", "2021.4", "2022.1", "2022.2",
  143. "2022.3", "2023.0", "2023.1", "2023.2", "2024.0",]
  144. update: [null, ANY]
  145. mode: ["icx", "classic", "dpcpp"]
  146. libcxx: [null, libstdc++, libstdc++11, libc++]
  147. cppstd: [null, 98, gnu98, "03", gnu03, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20, 23, gnu23]
  148. runtime: [null, static, dynamic]
  149. runtime_type: [null, Debug, Release]
  150. qcc:
  151. version: ["4.4", "5.4", "8.3"]
  152. libcxx: [cxx, gpp, cpp, cpp-ne, accp, acpp-ne, ecpp, ecpp-ne]
  153. cppstd: [null, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17]
  154. mcst-lcc:
  155. version: ["1.19", "1.20", "1.21", "1.22", "1.23", "1.24", "1.25"]
  156. libcxx: [libstdc++, libstdc++11]
  157. cppstd: [null, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20, 23, gnu23]
  158. build_type: [null, Debug, Release, RelWithDebInfo, MinSizeRel]

As you can see, the possible values of settings are defined in the same file. This is done to ensure matching naming and spelling as well as defining a common settings model among users and the OSS community. Some general information about settings:

  • If a setting is allowed to be set to any value, you can use ANY.

  • If a setting is allowed to be set to any value or it can also be unset, you can use [null, ANY].

However, this configuration file can be modified to any needs, including new settings or sub-settings and their values. If you want to distribute an unified settings.yml file you can use the conan config install command.

See also

Operating systems

baremetal operating system is a convention meaning that the binaries run directly on the hardware, without an operating system or equivalent layer. This is to differentiate to the null value, which is associated to the “this value is not defined” semantics. baremetal is a common name convention for embedded microprocessors and microcontrollers’ code. It is expected that users might customize the space inside the baremetal setting with further subsettings to specify their specific hardware platforms, boards, families, etc. At the moment the os=baremetal value is still not used by Conan builtin toolchains and helpers, but it is expected that they can evolve and start using it.

Compilers

Some notes about different compilers:

msvc

  • It uses the compiler version, that is 190 (19.0), 191 (19.1), etc, instead of the Visual Studio IDE (15, 16, etc).

  • It is only used by the new build integrations in conan.tools.cmake and conan.tools.microsoft, but not the previous ones.

When using the msvc compiler, the Visual Studio toolset version (the actual vcvars activation and MSBuild location) will be defined by the default provided by that compiler version:

  • msvc compiler version ‘190’: Visual Studio 14 2015

  • msvc compiler version ‘191’: Visual Studio 15 2017

  • msvc compiler version ‘192’: Visual Studio 16 2019

  • msvc compiler version ‘193’: Visual Studio 17 2022

This can be configured in your profiles with the tools.microsoft.msbuild:vs_version configuration:

  1. [settings]
  2. compiler=msvc
  3. compiler.version=190
  4. [conf]
  5. tools.microsoft.msbuild:vs_version = 16

In this case, the vcvars will activate the Visual Studio 16 installation, but the 190 compiler version will still be used because the necessary toolset=v140 will be set.

The settings define the last digit update: [null, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], which by default is null and means that Conan assumes binary compatibility for the compiler patches, which works in general for the Microsoft compilers. For cases where finer control is desired, you can just add the update part to your profiles:

  1. [settings]
  2. compiler=msvc
  3. compiler.version=191
  4. compiler.update=3

This will be equivalent to the full version 1913 (19.13). If even further details are desired, you could even add your own digits to the update subsetting in settings.yml.

intel-cc

Warning

This feature is experimental and subject to breaking changes. See the Conan stability section for more information.

This compiler is aimed to handle the new Intel oneAPI DPC++/C++/Classic compilers. Instead of having n different compilers, you have 3 different modes of working:

  • icx for Intel oneAPI C++.

  • dpcpp for Intel oneAPI DPC++.

  • classic for Intel C++ Classic ones.

Besides that, Intel releases some versions with revisions numbers so the update field is supposed to be any possible minor number for the Intel compiler version used, e.g, compiler.version=2021.1 and compiler.update=311 mean Intel version is 2021.1.311.

Architectures

Here you can find a brief explanation of each of the architectures defined as arch, arch_build and arch_target settings.

  • x86: The popular 32 bit x86 architecture.

  • x86_64: The popular 64 bit x64 architecture.

  • ppc64le: The PowerPC 64 bit Big Endian architecture.

  • ppc32: The PowerPC 32 bit architecture.

  • ppc64le: The PowerPC 64 bit Little Endian architecture.

  • ppc64: The PowerPC 64 bit Big Endian architecture.

  • armv5el: The ARM 32 bit version 5 architecture, soft-float.

  • armv5hf: The ARM 32 bit version 5 architecture, hard-float.

  • armv6: The ARM 32 bit version 6 architecture.

  • armv7: The ARM 32 bit version 7 architecture.

  • armv7hf: The ARM 32 bit version 7 hard-float architecture.

  • armv7s: The ARM 32 bit version 7 swift architecture mostly used in Apple’s A6 and A6X chips on iPhone 5, iPhone 5C and iPad 4.

  • armv7k: The ARM 32 bit version 7 k architecture mostly used in Apple’s WatchOS.

  • armv8: The ARM 64 bit and 32 bit compatible version 8 architecture. It covers only the aarch64 instruction set.

  • armv8_32: The ARM 32 bit version 8 architecture. It covers only the aarch32 instruction set (a.k.a. ILP32).

  • armv8.3: The ARM 64 bit and 32 bit compatible version 8.3 architecture. Also known as arm64e, it is used on the A12 chipset added in the latest iPhone models (XS/XS Max/XR).

  • arm64e: Windows 11 ARM64 (Emulation Compatible). This architecture support is experimental and incomplete. The only usage is to define CMAKE_GENERATOR_PLATFORM in CMake VS generators. Report new issues in Github if necessary.

  • sparc: The SPARC (Scalable Processor Architecture) originally developed by Sun Microsystems.

  • sparcv9: The SPARC version 9 architecture.

  • mips: The 32 bit MIPS (Microprocessor without Interlocked Pipelined Stages) developed by MIPS Technologies (formerly MIPS Computer Systems).

  • mips64: The 64 bit MIPS (Microprocessor without Interlocked Pipelined Stages) developed by MIPS Technologies (formerly MIPS Computer Systems).

  • avr: The 8 bit AVR microcontroller architecture developed by Atmel (Microchip Technology).

  • s390: The 32 bit address Enterprise Systems Architecture 390 from IBM.

  • s390x: The 64 bit address Enterprise Systems Architecture 390 from IBM.

  • asm.js: The subset of JavaScript that can be used as low-level target for compilers, not really a processor architecture, it’s produced by Emscripten. Conan treats it as an architecture to align with build systems design (e.g. GNU auto tools and CMake).

  • wasm: The Web Assembly, not really a processor architecture, but byte-code format for Web, it’s produced by Emscripten. Conan treats it as an architecture to align with build systems design (e.g. GNU auto tools and CMake).

  • sh4le: The Hitachi SH-4 SuperH architecture.

  • e2k-v2: The Elbrus 2000 v2 512 bit VLIW (Very Long Instruction Word) architecture (Elbrus 2CM, Elbrus 2C+ CPUs) originally developed by MCST (Moscow Center of SPARC Technologies).

  • e2k-v3: The Elbrus 2000 v3 512 bit VLIW (Very Long Instruction Word) architecture (Elbrus 2S, aka Elbrus 4C, CPU) originally developed by MCST (Moscow Center of SPARC Technologies).

  • e2k-v4: The Elbrus 2000 v4 512 bit VLIW (Very Long Instruction Word) architecture (Elbrus 8C, Elbrus 8C1, Elbrus 1C+ and Elbrus 1CK CPUs) originally developed by MCST (Moscow Center of SPARC Technologies).

  • e2k-v5: The Elbrus 2000 v5 512 bit VLIW (Very Long Instruction Word) architecture (Elbrus 8C2 ,aka Elbrus 8CB, CPU) originally developed by MCST (Moscow Center of SPARC Technologies).

  • e2k-v6: The Elbrus 2000 v6 512 bit VLIW (Very Long Instruction Word) architecture (Elbrus 2C3, Elbrus 12C and Elbrus 16C CPUs) originally developed by MCST (Moscow Center of SPARC Technologies).

  • e2k-v7: The Elbrus 2000 v7 512 bit VLIW (Very Long Instruction Word) architecture (Elbrus 32C CPU) originally developed by MCST (Moscow Center of SPARC Technologies).

  • xtensalx6: Xtensa LX6 DPU for ESP32 microcontroller.

  • xtensalx106: Xtensa LX6 DPU for ESP8266 microcontroller.

  • xtensalx7: Xtensa LX7 DPU for ESP32-S2 and ESP32-S3 microcontrollers.

C++ standard libraries (aka compiler.libcxx)

compiler.libcxx sub-setting defines C++ standard libraries implementation to be used. The sub-setting applies only to certain compilers, e.g. it applies to clang, apple-clang and gcc, but doesn’t apply to Visual Studio.

Customizing settings

Settings are also customizable to add your own ones:

Adding new settings

It is possible to add new settings at the root of the settings.yml file, something like:

  1. os:
  2. Windows:
  3. subsystem: [null, cygwin, msys, msys2, wsl]
  4. distro: [null, RHEL6, CentOS, Debian]

If we want to create different binaries from our recipes defining this new setting, we would need to add to our recipes that:

  1. class Pkg(ConanFile):
  2. settings = "os", "compiler", "build_type", "arch", "distro"

The value null allows for not defining it (which would be a default value, valid for all the other distros). It is also possible to define values for it in the profiles:

  1. [settings]
  2. os = "Linux"
  3. distro = "CentOS"
  4. compiler = "gcc"

And use their values to affect our build if desired:

  1. class Pkg(ConanFile):
  2. settings = "os", "compiler", "build_type", "arch", "distro"
  3. def generate(self):
  4. tc = CMakeToolchain(self)
  5. if self.settings.distro == "CentOS":
  6. tc.cache_variables["SOME_CENTOS_FLAG"] = "Some CentOS Value"
  7. ...

Adding new sub-settings

The above approach requires modification to all recipes to take it into account. It is also possible to define kind of incompatible settings, like os=Windows and distro=CentOS. While adding new settings is totally suitable, it might make more sense to add it as a new sub-setting of the Linux OS:

  1. os:
  2. Windows:
  3. subsystem: [null, cygwin, msys, msys2, wsl]
  4. Linux:
  5. distro: [null, RHEL6, CentOS, Debian]

With this definition we could define our profiles as:

  1. [settings]
  2. os = "Linux"
  3. os.distro = "CentOS"
  4. compiler = "gcc"

And any attempt to define os.distro for another os value rather than Linux will raise an error.

As this is a sub-setting, it will be automatically taken into account in all recipes that declare an os setting. Note that having a value of distro=null possible is important if you want to keep previously created binaries, otherwise you would be forcing to always define a specific distro value, and binaries created without this sub-setting, won’t be usable anymore.

The sub-setting can also be accessed from recipes:

  1. class Pkg(ConanFile):
  2. settings = "os", "compiler", "build_type", "arch" # Note, no "distro" defined here
  3. def generate(self):
  4. tc = CMakeToolchain(self)
  5. if self.settings.os == "Linux" and self.settings.os.distro == "CentOS":
  6. tc.cache_variables["SOME_CENTOS_FLAG"] = "Some CentOS Value"

It is possible to have ANY to define nested subsettings, being the ANY the fallback for any value not matching the defined ones:

  1. os:
  2. ANY:
  3. version: [null, ANY]
  4. Ubuntu:
  5. version: ["18.04", "20.04"]

This will allow settings like -s os=MyOS -s os.version=1.2.3, because the version can be ANY for os!=Ubuntu, but if we try -s os=Ubuntu -s os.version=1.2.3 it will error because Ubuntu only accept those defined versions.

Add new values

In the same way we have added a new distro sub-setting, it is possible to add new values to existing settings and sub-settings. For example, if some compiler version is not present in the range of accepted values, you can add those new values.

You can also add a completely new compiler:

  1. os:
  2. Windows:
  3. subsystem: [null, cygwin, msys, msys2, wsl]
  4. ...
  5. compiler:
  6. gcc:
  7. ...
  8. mycompiler:
  9. version: [1.1, 1.2]
  10. msvc:

This works as the above regarding profiles, and the way they can be accessed from recipes. The main issue with custom compilers is that the builtin build helpers, like CMake, MSBuild, etc, internally contains code that will check for those values. For example, the MSBuild build helper will only know how to manage the msvc setting and sub-settings, but not the new compiler. For those cases, custom logic can be implemented in the recipes:

  1. class Pkg(ConanFile):
  2. settings = "os", "compiler", "build_type", "arch"
  3. def build(self):
  4. if self.settings.compiler == "mycompiler":
  5. my_custom_compile = ["some", "--flags", "for", "--my=compiler"]
  6. self.run(["mycompiler", "."] + my_custom_compile)

Note

You can remove items from settings.yml file: compilers, OS, architectures, etc. Do that only in the case you really want to protect against creation of binaries for other platforms other than your main supported ones. In the general case, you can leave them, the binary configurations are managed in profiles, and you want to define your supported configurations in profiles, not by restricting the settings.yml

Note

If you customize your settings.yml, you can share, distribute and sync this configuration with your team and CI machines with the conan config install command.

settings_user.yml

The previous section explains how to customize the Conan settings.yml, but you could also create your settings_user.yml. This file will contain only the new fields-values that you want to use in your recipes, so the final result will be a composition of both files, the settings.yml and the settings_user.yml.

See also