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

Document new function conan.tools.gnu.is_mingw() #2849

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions reference/conanfile/tools/gnu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ conan.tools.gnu
gnu/autotoolsdeps
gnu/autotoolstoolchain
gnu/autotools
gnu/mingw
gnu/pkgconfigdeps
gnu/pkgconfig
27 changes: 27 additions & 0 deletions reference/conanfile/tools/gnu/mingw.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. _conan_tools_gnu_mingw:

conan.tools.gnu.is_mingw()
--------------------------

Available since: `1.57.0 <https://github.com/conan-io/conan/releases/tag/1.57.0>`_

.. code-block:: python

def is_mingw(conanfile):

Check whether ``self.settings`` is a MinGW compiler.
It returns ``True`` when host os is ``Windows`` and host compiler is ``gcc`` or ``clang``
and ``compiler.runtime`` is not set, otherwise returns ``False``.
When the ``compiler`` is empty, it returns ``False``.

Parameters:

- **conanfile**: ConanFile instance.

.. code-block:: python

from conan.tools.gnu import is_mingw

def build(self):
if is_mingw(self):
# some logic to build with mingw