From bc3973259c0a608eb54ad9c4446c05d1668d030e Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Sun, 16 Apr 2017 11:41:12 -0700 Subject: [PATCH] CMake: add support for SSE4.2 Summary: Closes https://github.com/facebook/rocksdb/pull/2159 Differential Revision: D4894483 Pulled By: yiwu-arbug fbshipit-source-id: 607e17e8ef5d30dce02c27be9d1de7d9f823b4ae --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 924ec711f..cdf9feef8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,7 +55,7 @@ else() add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) include_directories(${JEMALLOC_INCLUDE_DIR}) endif() - endif() + endif() option(WITH_SNAPPY "build with SNAPPY" OFF) if(WITH_SNAPPY) find_package(snappy REQUIRED) @@ -115,6 +115,11 @@ if(WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2") endif() endif() +else() + option(WITH_SSE42 "build with SSE4.2" ON) + if(WITH_SSE42) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2") + endif() endif() set(BUILD_VERSION_CC ${CMAKE_BINARY_DIR}/build_version.cc)