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

<host_version:track ref> docs #3480

Merged
merged 1 commit into from
Dec 18, 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
15 changes: 15 additions & 0 deletions reference/conanfile/methods/build_requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@ Then, if any user wants to use *mylib/0.1*, but another version of *protobuf*, t

The ``<host_version>`` defined upstream is ensuring that the host and build contexts are using the same version of that requirement.

Additionally, the syntax ``<host_version:mylib>`` can be used to specify the name of the package to be tracked,
should the *requires* and *tool_requires* have different names. For instance:

.. code-block:: python

from conan import ConanFile

class mylibRecipe(ConanFile):
name = "mylib"
version = "0.1"
def requirements(self):
self.requires("gettext/2.31")
def build_requirements(self):
self.tool_requires("libgettext/<host_version:gettext>")


.. seealso::

Expand Down