From 3ef092f83f287cf5c6e97fa6603c5af79ad4c8af Mon Sep 17 00:00:00 2001 From: monchickey <75814968+monchickey@users.noreply.github.com> Date: Wed, 18 Oct 2023 21:04:27 +0800 Subject: [PATCH] Fix the compilation error that occurs when opening avx series instructions (#55049) * fix the compilation error that occurs when opening avx series instructions cmake command example: ```shell cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_AVX=ON -DENABLE_AVX2=ON -DENABLE_AVX2_FOR_SPEC_OP=ON ``` * Update snappy CMakeLists.txt add SNAPPY_HAVE_X86_CRC32 parameter --- contrib/snappy-cmake/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/snappy-cmake/CMakeLists.txt b/contrib/snappy-cmake/CMakeLists.txt index f406de0e343..d923ddef6b6 100644 --- a/contrib/snappy-cmake/CMakeLists.txt +++ b/contrib/snappy-cmake/CMakeLists.txt @@ -24,6 +24,12 @@ else () set (SNAPPY_HAVE_SSSE3 0) endif () +if (ARCH_AMD64 AND ENABLE_SSE42) + set (SNAPPY_HAVE_X86_CRC32 1) +else () + set (SNAPPY_HAVE_X86_CRC32 0) +endif () + configure_file( "${SOURCE_DIR}/cmake/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h")