Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs for default_build_options #3338

Merged
merged 1 commit into from
Aug 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions reference/conanfile/attributes/binary_model.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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``,...).

Expand Down Expand Up @@ -235,6 +235,24 @@ Take into account that if a value is assigned in the ``configure()`` method it c

Read more about the <MISSING PAGE>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
-------------------
Expand Down