Skip to content

Commit 44ec59b

Browse files
authored
Improve context for platform_tool_requires (#4162)
* Add explanation for platform_tool_requires context * Add same warning to replace_tool_requires
1 parent 9531445 commit 44ec59b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

reference/config_files/profiles.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,12 @@ Same usage as the `replace_requires` section but in this case for `tool_requires
445445
446446
In this case, whatever version of ``cmake`` declared in recipes, will be replaced by the reference `cmake/3.25.2`.
447447

448+
.. note::
449+
450+
* This section should be added to the profile whose context is the one that requires the tool, i.e., if the
451+
tool is required in the host context, then it should be added to the host profile, so that the requirement
452+
itself can be replaced.
453+
448454

449455
.. _reference_config_files_profiles_platform_requires:
450456

@@ -540,9 +546,13 @@ declaration:
540546
Build requirements
541547
cmake/3.24.2 - Platform
542548
543-
Note that if the ``platform_tool_requires`` declared **does not make a strict match** with the ``tool_requires`` one (version or
544-
version range), then Conan will try to bring them remotely or locally as usual.
549+
.. note::
545550

551+
* If the ``platform_tool_requires`` declared **does not make a strict match** with the ``tool_requires`` one (version or
552+
version range), then Conan will try to bring them remotely or locally as usual.
553+
* This section should be added to the profile whose context is the one that requires the tool, i.e., if the
554+
tool is required in the host context, then it should be added to the host profile, so that the requirement
555+
itself can be replaced by the platform one.
546556

547557
.. _reference_config_files_profiles_rendering:
548558

0 commit comments

Comments
 (0)