MINGW: Define variable only when targeting Windows platforms
The MINGW
variable indicates that the compiler targets MinGW, a GNU
ABI on Windows. Since commit aff31479, we load the Platform/Windows-GNU
module for compilers targetin MinGW, so set the variable there instead.
This is equivalent to Platform/Windows-MSVC
setting the MSVC
variable. Also remove if(MINGW)
checks from the module, which have
not been necessary since the enclosed logic was moved to that module.
The undocumented CMAKE_COMPILER_IS_MINGW
internal variable is now
unused, so remove it too.
While at it, also remove redundant definitions of CYGWIN
and UNIX
variables on Cygwin.
These are set by modules loaded for CMAKE_SYSTEM_NAME
. We do not
need to set them again if the compiler defines __CYGWIN__
.
Fixes: #22647 (closed)