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

cppstd ported tools #2616

Merged
merged 2 commits into from Jun 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
lasote marked this conversation as resolved.
Show resolved Hide resolved
----------------------------------

.. 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