From: Nathan Cutler Date: Thu, 27 Apr 2017 10:06:36 +0000 (+0200) Subject: cmake: do not add -msse4.2 GCC option if not supported X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F18%2Fhead;p=rocksdb.git cmake: do not add -msse4.2 GCC option if not supported Fixes non-Intel builds Signed-off-by: Nathan Cutler --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b1719de..bd99d061 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,7 +125,12 @@ if(WIN32) endif() endif() else() - option(WITH_SSE42 "build with SSE4.2" ON) + CHECK_CXX_COMPILER_FLAG("-msse4.2" HAVE_MSSE_42) + if(HAVE_MSSE_42) + option(WITH_SSE42 "build with SSE4.2" ON) + else() + option(WITH_SSE42 "build with SSE4.2" OFF) + endif() if(WITH_SSE42) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2") endif()