enable_language: Default platform variables updated too late
The builtin `WIN32`, `UNIX`, and `APPLE` variables are set by code [here](https://gitlab.kitware.com/cmake/cmake/-/blob/v3.22.3/Source/cmStateSnapshot.cxx#L295-318) based on the *host* platform. They are removed by `CMakeSystemSpecificInformation` [here](https://gitlab.kitware.com/cmake/cmake/-/blob/v3.22.3/Modules/CMakeSystemSpecificInformation.cmake#L9-18) in preparation for a `Platform/${CMAKE_SYSTEM_NAME}` module to set information about the actual *target* platform, which may be different when cross-compiling.
In between these two steps, we may [enable languages](https://gitlab.kitware.com/cmake/cmake/-/blob/v3.22.3/Source/cmGlobalGenerator.cxx#L469-481), in which case the `CMakeDetermine${LANG}Compiler` module is loaded with `WIN32`, `UNIX`, or `APPLE` possibly defined based on the host platform instead of the target platform.
issue