Skip to content
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