https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5176f580e575068f788bf…
commit 5176f580e575068f788bfbce7d28a333a2c85b55
Author:     Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Mon Aug 2 00:23:10 2021 +0300
Commit:     Victor Perevertkin <victor.perevertkin(a)reactos.org>
CommitDate: Mon Aug 2 20:23:22 2021 +0300
    [CMAKE] Add memcmp to libntoskrnl for both clang and clang-cl
---
 ntoskrnl/CMakeLists.txt | 2 +-
 sdk/cmake/msvc.cmake    | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/ntoskrnl/CMakeLists.txt b/ntoskrnl/CMakeLists.txt
index 6849bcf0099..a359482aad8 100644
--- a/ntoskrnl/CMakeLists.txt
+++ b/ntoskrnl/CMakeLists.txt
@@ -28,7 +28,7 @@ endif()
 add_asm_files(ntoskrnl_asm ${NTOSKRNL_ASM_SOURCE})
-if (GCC AND CLANG)
+if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
     # Clang optimises strcmp calls to memcmp.
     target_sources(libntoskrnl PRIVATE $<TARGET_OBJECTS:memcmp>)
 endif()
diff --git a/sdk/cmake/msvc.cmake b/sdk/cmake/msvc.cmake
index f32f88cf786..139a886f30f 100644
--- a/sdk/cmake/msvc.cmake
+++ b/sdk/cmake/msvc.cmake
@@ -1,6 +1,10 @@
 if(CMAKE_BUILD_TYPE STREQUAL "Release")
-    add_compile_options(/Ox /Ob2 /Ot /Oy /GT)
+    add_compile_options(/Ox /Ob2 /Ot /Oy)
+    # Avoid spam in clang-cl as it doesn't support /GT
+    if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
+        add_compile_options(/GT)
+    endif()
 elseif(OPTIMIZE STREQUAL "1")
     add_compile_options(/O1)
 elseif(OPTIMIZE STREQUAL "2")