From a44ddd2a019723c63b7f2e0ebc09072ad151e626 Mon Sep 17 00:00:00 2001 From: Clinton Ingram Date: Mon, 20 Nov 2023 22:13:46 -0800 Subject: [PATCH] fix SSE detection logic --- CMakeLists.txt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 21310875..250e3cdc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,14 +44,17 @@ if(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} MATCHES Clang) add_definitions(-Wall) endif() +set(DISABLE_SSE ON) check_c_source_compiles( - "#if !defined(__x86_64) && !defined(__i386__) \\ - && !defined(_M_IX86) && !defined(_M_AMD64) - #error not x86 - #endif - int main(){return 0;}" - HAVE_X86) -set(DISABLE_SSE "Disable SSE optimizations" ${HAVE_X86}) + "#if !defined(__x86_64) && !defined(__i386__) \ + && !defined(_M_IX86) && !defined(_M_AMD64) + #error not x86 + #endif + int main(){return 0;}" + HAVE_X86) +if (HAVE_X86) + set(DISABLE_SSE OFF) +endif() option(BUILD_SHARED_LIBS "Build shared library" ON) if(NOT BUILD_SHARED_LIBS)