Check that MSan builds use Clang

Bug: b/155148722
Change-Id: Idd8a9109eebaa436eee69eddde9a399402fe5119
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/50808
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b21d9ed..55b7fc9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -520,6 +520,11 @@
     set_cpp_flag("-fomit-frame-pointer" RELEASE)
 
     if(SWIFTSHADER_MSAN)
+        if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+            message(FATAL_ERROR " \n"
+                    " MemorySanitizer usage requires compiling with Clang.")
+        endif()
+
         if(NOT DEFINED ENV{SWIFTSHADER_MSAN_INSTRUMENTED_LIBCXX_PATH})
             message(FATAL_ERROR " \n"
                     " MemorySanitizer usage requires an instrumented build of libc++.\n"