Skip to content

Commit

Permalink
cppstd ported tools (#2616)
Browse files Browse the repository at this point in the history
* cppstd ported tools

* Review
  • Loading branch information
lasote committed Jun 29, 2022
1 parent 91f0146 commit 4604bb9
Showing 1 changed file with 61 additions and 1 deletion.
62 changes: 61 additions & 1 deletion reference/conanfile/tools/build.rst
Expand Up @@ -23,7 +23,7 @@ Parameters:


conan.tools.build.can_run()
----------------------------------
---------------------------

.. code-block:: python
Expand All @@ -38,3 +38,63 @@ It's an useful feature for the case your architecture can run more than one targ
Parameters:

- **conanfile**: Conanfile object, use always ``self``.


conan.tools.build.check_min_cppstd
----------------------------------


.. code-block:: python
def check_min_cppstd(conanfile, cppstd, gnu_extensions=False)
Check if provided ``conanfile.settings.compiler.cppstd`` fits the minimal version required (specified in the argument ``cppstd``).
In case it doesn't, a ``ConanInvalidConfiguration`` exception will be raised.

Parameters:

- **conanfile**: The current recipe object. Always use ``self``.
- **cppstd**: Minimal cppstd version required.
- **gnu_extensions**: GNU extension is required (e.g gnu17).


conan.tools.build.default_cppstd
----------------------------------

.. code-block:: python
def default_cppstd(conanfile, compiler=None, compiler_version=None):
Get the default ``compiler.cppstd`` for the "conanfile.settings.compiler" and "conanfile
settings.compiler_version" or for the parameters "compiler" and "compiler_version" if specified.
Returns the default ``compiler.cppstd`` for the specified compiler.

Parameters:

- **conanfile**: The current recipe object. Always use ``self``.
- **compiler**: Name of the compiler e.g. gcc
- **compiler_version**: Version of the compiler e.g. 12


conan.tools.build.supported_cppstd
----------------------------------

.. code-block:: python
def supported_cppstd(conanfile, compiler=None, compiler_version=None):
Get the a list of supported ``compiler.cppstd`` for the "conanfile.settings.compiler" and
"conanfile.settings.compiler_version" or for the parameters "compiler" and "compiler_version"
if specified. Returns a list of supported ``cppstd`` values.


Parameters:

- **conanfile**: The current recipe object. Always use ``self``.
- **compiler**: Name of the compiler e.g: gcc
- **compiler_version**: Version of the compiler e.g: 12

0 comments on commit 4604bb9

Please sign in to comment.