MINGW variable indicates that the compiler targets MinGW, a GNU
ABI on Windows. Since the
compiler's target may be affected by flags
known only after compiler identification (EDIT: only if
CMAKE_<LANG>_COMPILER_TARGET is defined after compiler identification, such as the Android-Clang case in the motivating issue), delay defining the
variable until the ABI detection step.
Also remove the now-unused undocumented
While at it, also remove redundant definitions of
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
Fixes: #22647 (closed)