Separate compiler optimization options by architecture.

This commit is contained in:
2021-09-26 17:42:32 +01:00
parent 6b45dd6e5b
commit 84f639b3d2

View File

@@ -3,6 +3,11 @@ project("Aaru.Checksums.Native" C)
set(CMAKE_C_STANDARD 90)
add_compile_options(-flto -ffast-math -march=x86-64 -mfpmath=sse -msse3)
message("Detected system processor: ${CMAKE_SYSTEM_PROCESSOR}")
add_compile_options(-flto -ffast-math)
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
add_compile_options(-march=x86-64 -mfpmath=sse -msse3 -mtune=core2)
endif()
add_library("Aaru.Checksums.Native" SHARED adler32.h adler32.c crc16.h crc16.c crc16_ccitt.h crc16_ccitt.c crc32.c crc32.h crc64.c crc64.h fletcher16.h fletcher16.c fletcher32.h fletcher32.c library.h spamsum.c spamsum.h crc32_clmul.c crc64_clmul.c simd.c simd.h)