]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
cmake: do not add -msse4.2 GCC option if not supported wip-msse 18/head
authorNathan Cutler <ncutler@suse.com>
Thu, 27 Apr 2017 10:06:36 +0000 (12:06 +0200)
committerNathan Cutler <ncutler@suse.com>
Thu, 27 Apr 2017 10:06:36 +0000 (12:06 +0200)
Fixes non-Intel builds

Signed-off-by: Nathan Cutler <ncutler@suse.com>
CMakeLists.txt

index 1b1719de5776a23a594e0865901948eb16999352..bd99d0618d312cbd1ed2ae5e4cf4191d42dd9147 100644 (file)
@@ -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()