From 547dcb15b24dd257117a9a33200056d628c55612 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 9 Dec 2022 01:36:34 +0100 Subject: [PATCH 1/2] document conan.tools.gnu.is_mingw() --- reference/conanfile/tools/gnu.rst | 1 + reference/conanfile/tools/gnu/mingw.rst | 27 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 reference/conanfile/tools/gnu/mingw.rst diff --git a/reference/conanfile/tools/gnu.rst b/reference/conanfile/tools/gnu.rst index 5984334071c..0bba1e4f247 100644 --- a/reference/conanfile/tools/gnu.rst +++ b/reference/conanfile/tools/gnu.rst @@ -14,5 +14,6 @@ conan.tools.gnu gnu/autotoolsdeps gnu/autotoolstoolchain gnu/autotools + gnu/mingw gnu/pkgconfigdeps gnu/pkgconfig diff --git a/reference/conanfile/tools/gnu/mingw.rst b/reference/conanfile/tools/gnu/mingw.rst new file mode 100644 index 00000000000..ab2a675e407 --- /dev/null +++ b/reference/conanfile/tools/gnu/mingw.rst @@ -0,0 +1,27 @@ +.. _conan_tools_gnu_mingw: + +conan.tools.gnu.is_mingw() +-------------------------- + +Available since: `1.56.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 From 7e42d7f6a676086424d51057dfc4346430215c61 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sun, 1 Jan 2023 17:57:22 +0100 Subject: [PATCH 2/2] maybe in 1.57.0? --- reference/conanfile/tools/gnu/mingw.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/conanfile/tools/gnu/mingw.rst b/reference/conanfile/tools/gnu/mingw.rst index ab2a675e407..739c8916b3a 100644 --- a/reference/conanfile/tools/gnu/mingw.rst +++ b/reference/conanfile/tools/gnu/mingw.rst @@ -3,7 +3,7 @@ conan.tools.gnu.is_mingw() -------------------------- -Available since: `1.56.0 `_ +Available since: `1.57.0 `_ .. code-block:: python