[CMAKE] Add memcmp to libntoskrnl for both clang and clang-cl

This commit is contained in:
Victor Perevertkin 2021-08-02 00:23:10 +03:00
parent 03506b90e0
commit 5176f580e5
No known key found for this signature in database
GPG key ID: C750B7222E9C7830
2 changed files with 6 additions and 2 deletions

View file

@ -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()

View file

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