From 48e605a05026f88552b58167a10e2f8a89ef7666 Mon Sep 17 00:00:00 2001 From: czoido Date: Mon, 28 Aug 2023 14:30:35 +0200 Subject: [PATCH] add docs --- .../conanfile/attributes/binary_model.inc | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/reference/conanfile/attributes/binary_model.inc b/reference/conanfile/attributes/binary_model.inc index b1304a6f633f..fb3c379263c7 100644 --- a/reference/conanfile/attributes/binary_model.inc +++ b/reference/conanfile/attributes/binary_model.inc @@ -121,10 +121,10 @@ For example, in the ``configure()`` method a typical pattern for a C library wou options ------- -Dictionary with traits that affects only the current recipe, where the key is the -option name and the value is a list of different values that the option can take. -By default any value change in an option, changes the ``package_id``. Check the -``default_options`` field to define default values for the options. +Dictionary with traits that affects only the current recipe, where the key is the option +name and the value is a list of different values that the option can take. By default any +value change in an option, changes the ``package_id``. Check the ``default_options`` and +``default_build_options`` fields to define default values for the options. Values for each option can be typed or plain strings (``"value"``, ``True``, ``42``,...). @@ -235,6 +235,24 @@ Take into account that if a value is assigned in the ``configure()`` method it c Read more about the method_configure_config_options method. +default_build_options +--------------------- + +The attribute ``default_build_options`` defines the default values for the options in the +build context and is tipically used for defining options for ``tool_requires``. + + +.. code-block:: python + + from conan import ConanFile + class Consumer(ConanFile): + default_options = {"protobuf/*:shared": True} + default_build_options = {"protobuf/*:shared": False} + def requirements(self): + self.requires("protobuf/1.0") + def build_requirements(self): + self.build_requires("protobuf/1.0") + options_description -------------------