]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/CMakeLists.txt
update sources to v12.2.5
[ceph.git] / ceph / src / rocksdb / CMakeLists.txt
index 5f82b33af921badfbfbf7df70b7088a68b8f58d2..983f0be9f70c891b4a3224f43d12cf6310f1a96a 100644 (file)
@@ -156,6 +156,24 @@ else()
   endif()
 endif()
 
+include(CheckCXXSourceCompiles)
+if(NOT MSVC)
+  set(CMAKE_REQUIRED_FLAGS "-msse4.2")
+endif()
+CHECK_CXX_SOURCE_COMPILES("
+#include <cstdint>
+#include <nmmintrin.h>
+int main() {
+  volatile uint32_t x = _mm_crc32_u32(0, 0);
+}
+" HAVE_SSE42)
+unset(CMAKE_REQUIRED_FLAGS)
+if(HAVE_SSE42 AND NOT WITH_SSE42)
+set_source_files_properties(
+  util/crc32c.cc
+  PROPERTIES COMPILE_FLAGS "-msse4.2")
+endif()
+
 option(FAIL_ON_WARNINGS "Treat compile warnings as errors" ON)
 if(FAIL_ON_WARNINGS)
   if(MSVC)