Hello,
Option -EHa is defined in adm/cmake/occt_defs_flags.cmake if "WIN32" is set -- in that case it is assumed (incorrectly) that compiler is Visual Studio. Apparently here "WIN32" should be replaced by "MSVC".
Note that in MSVC the opton -EHa enables support of unstructured exceptions. It does not affect normal execution of the program, however it is essential for OCCT support of conversion of low-level C signals to C++ exceptions, see OSD::SetSignal().
If you are going to use this feature on your system, you will likely have to adapt OCCT signal handlers defined in OSD_signal.cxx or OSD_signal_WNT.cxx to msys2/mingw64 specifics.
Commenter-1