In MSVC mode, CMake provides CMAKE_C_COMPILER_ARCHITECTURE_ID,
which should be accurate for what the compiler produces. Keep
the old CMAKE_C_SIZEOF_VOID_P based fallback in case this
doesn't provide matches.
In GCC/MinGW mode, CMake doesn't provide that. As we're trying to
guess the default host architecture, use CMAKE_HOST_SYSTEM_PROCESSOR
in combination with the existing CMAKE_C_SIZEOF_VOID_P check to
estimate whether it's x86/x86_64/arm/aarch64.
I made a MR to upstream CMake to make it provide
CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID for GCC and non-MSVC Clang
configurations too, in
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6432,
but I wouldn't want to start relying on that right away.