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 $) 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")