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

tools.check_min_cppstd: add warning about API usage #2191

Closed
Closed
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
9 changes: 8 additions & 1 deletion reference/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1753,7 +1753,8 @@ It raises a ``ConanInvalidConfiguration`` when is not supported.
...

def configure(self):
tools.check_min_cppstd(self, "17")
if self.settings.compiler.get_safe("cppstd"):
tools.check_min_cppstd(self, "17")

* If the current cppstd does not support C++17, ``check_min_cppstd`` will raise an ``ConanInvalidConfiguration`` error.
* If ``gnu_extensions`` is True, it is required that the applied ``cppstd`` supports the gnu extensions.
Expand All @@ -1765,6 +1766,12 @@ Parameters:
- **cppstd** (Required): C++ standard version which must be supported.
- **gnu_extensions** (Optional): GNU extension is required.

.. warning::

All calls to ``tools.check_min_cppstd`` must be guarded by a check for the setting ``cppstd`` as this setting could absent
in some cases. See `the Conan-Center's FAQ for more details<https://github.com/conan-io/conan-center-index/blob/master/docs/faqs.md#why-is-a-toolscheck_min_cppstd-call-not-enough>`.


.. _tools.valid_min_cppstd:

tools.valid_min_cppstd()
Expand Down