diff --git a/reference/conanfile/tools/build.rst b/reference/conanfile/tools/build.rst index 1f597c56c09..14fc7e763ea 100644 --- a/reference/conanfile/tools/build.rst +++ b/reference/conanfile/tools/build.rst @@ -23,7 +23,7 @@ Parameters: conan.tools.build.can_run() ----------------------------------- +--------------------------- .. code-block:: python @@ -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