--- a/tests/tests.cmake
+++ b/tests/tests.cmake
@@ -3,7 +3,7 @@
 enable_testing()
 
 # -fno-sanitize-recover
-if(APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc|ppc64")
+if((MINGW AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*|arm64.*|ARM64.*)")) OR (APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc|ppc64"))
 # Darwin PPC does not support ubsan presently.
     set(sanitizer_opts "")
 else()
