From ea5904c3a079f3551ed8aa30f12a279102860255 Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Thu, 27 Apr 2017 12:06:36 +0200 Subject: [PATCH] cmake: do not add -msse4.2 GCC option if not supported Fixes non-Intel builds Signed-off-by: Nathan Cutler --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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() -- 2.47.3